How the HTML image label uses

Source: Internet
Author: User
Tags relative

1.

2.

Simply plain Web pages if only text without images will lose a lot of vitality, the image in the production of Web pages is a very important

aspect, the HTML language also specifically provides tags to handle the output of an image.

1.

The tag does not really add images to the HTML document, but instead assigns the SRC attribute of the label to the file name of the graphic file, including the path, which can be a relative path or a URL. In effect, you embed a graphics file into your document through a path. You may not know what a relative path is, and I'm going to talk about relative paths right now. The relative path is the path that you want to link to or embed in the current file relative to the current HTML document. If your HTML file is in the same directory as the graphics file (the filename is assumed to be logo.gif), you can write the code as ; If your graphics file is placed in a subdirectory of the current HTML document's directory ( The subdirectory name is assumed to be images), the code should be ; If your graphics file is placed in the upper directory of the current HTML document (directory

Name hypothesis is home), the relative path must be a quasi URL, which is used. /"represents your site and then follows the path of the file in your site, assuming that home is a directory under your site, the code should be . Now you should have a better understanding of the relative path!

It must be emphasized that the SRC attribute must be assigned in the tag and is an integral part of the label. In addition, the, label also has the ALT, align, border, width, and height attributes. Align is the alignment of the image, in the front of the tutorial has been a lot of talk, here is no longer mentioned. The border property is the border of an image that can be an integer greater than or equal to 0, and the default unit is pixels. The width and Height properties are the width and height of the image, and the default units are pixels. The Alt property is the text that is displayed when the mouse is moved over the image.

2.

The following is a comprehensive example of this tutorial.

Example 5 Image Label Example

A comprehensive example of <title> image labels </title>

<body>

<p align= "center" ></p>

</body>

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.