Image Tag attributes in HTML

Source: Internet
Author: User

Image Tag attributes in HTML
Images can make webpages more vivid and beautiful. The browser can display JPEG and GIF images. a GIF image can only contain up to 256 colors (that is, it can only be saved as an 8-bit face filter ).
The JPEG format can be stored as 24 BITs, which has the best effect on the specific continuous tone image. However, although GIF images are inferior to JPEG images in terms of image quality
The download speed is high under the storage space occupied by OSS. Therefore, the format of the image should be determined based on different situations.
The inserted graph in the HTML document is implemented by the label. The tag has nine attributes. Except for the property SRC, all other properties are optional.
.

1. SRC attributes. SRC: source. This attribute is used to indicate the location of the referenced image file. For example:
Absolute path representation:
Relative Path representation:
The property parameter value of SRC is the URL of the image file. Note that the relative representation can be used only when the image file and HTML file are in the same directory.
Position of the component.
Ii. Align attribute. The parameter values of the align attribute are top, middle, and bottom, respectively, indicating that the adjacent Text of the image is located in the middle of the left, and lower right of the image.
. For example:
<HTML>
<Head>
<Title> test page </title>
</Head>
<Body>
<HR>
is my icon nice?
<Br>
<HR>
<P> <br>
Let's take a look at this?
<br>
<P>
<HR>
</Body>
<HTML>
You can replace an image with your own one. Note: The default directory of the browser is the Windows/temp Temporary Folder. You need to specify the directory where the image is located.
Iv. Alt attributes. When you browse a webpage, you often choose not to download the image to save time or other reasons. You can add the alt attribute to
The location displays information about the image. The parameter value of the alt attribute is the text that the Web editor wants to appear in the place where the original image is displayed.
Is the name and brief description of the image. For example.
<HTML>
<Head>
<Title> test page </title>
</Head>
<Body>
<HR>

You can't see it, right? Hey
<Br>
<HR>
<P> <br>
<Br> <p>
</Body>
</Html>
5. Determine the attributes of the image margin.
labels use the vspace and hspace attributes to determine the blank size between the image and the object adjacent to the image. The vspace attribute is used to specify the vertical side of an image
The distance between adjacent objects. Used to specify the distance between an image and its adjacent objects in the horizontal direction. The parameters of these two attributes are numbers, indicating that the parameter is null.
The number of pixels in the distance.
6. Border attributes.
When calling an image, the browser adds a border with different widths to the image based on the size of the browser window and the original image. We can use the border attribute to specify the Graph
Border width or border cancellation <border = 0>. The parameter value of the border attribute is also a number, indicating the number of pixels occupied by the Border width. For example:
<HTML>
<Head>
<Title> test page </title>
</Head>
<Body>
<HR>

Just look at the effect.
<Br>
<HR>
<P> <br>
</Body>
</Html>
The larger the border parameter value, the larger the border.
7. ismap attributes
This attribute is related to the hyperlink of the document. We will explain it in detail later.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.