Web page to make image file path

Source: Internet
Author: User
Tags relative

        1) Image markup Overview.

If a Web page has only text and no images, like a lot of energy, images are a very important aspect of Web page making, and the HTML specialty provides tags to print images to a Web page. The tag has the SRC, ALT, ALIGN, BORDER, width, and height attributes.

2) Property description. The

src attribute. For tag, its src attribute is an inevitable attribute, that is, the SRC in the tag must be assigned a value and is an integral part of the tag. At this point, IMG should be written in the following format:


where the parameter value is the filename name and path of the image.

We know that image files occupy more space than plain text files such as HTML documents. and web design often need to add a lot of images in order to increase attractiveness, if the image files are added to the HTML document, the HTML document will become very large, transmission on the network will inevitably be slow. The

tag does not actually add an image to an HTML document, but rather tells the HTML: which is the image file? Where is it? So that the HTML goes to the original location of the image file to invoke it. The SRC attribute is to answer these two questions, so the SRC attribute's parameter value must have the image file's filename full name, namely filename and extension, such as logo.gif, this answers the image file is which question, its parameter value also must have the path of the image file, so that the HTML knows where to find the image file. The path to composing an image file is often a problem for beginners in the parameter values of the

src attribute. The path to the

image file can be a relative path or a Web address. A relative path is a path that is formed by the relative position of the file to be linked or embedded in the current HTML document with the current HTML file. If the HTML file and the image file (assuming the name is logo.gif) in the same directory, you can write the code as If the image file is placed in a subdirectory of the directory where the current HTML file is located (assuming the subdirectory name is images), the code should be If the image file is placed in the upper directory of the directory where the current HTML file is located (assuming the upper directory name is home), the relative path must be a quasi URL, i.e. /"to express openThe sender's website and then follow the path to the image file in the developer's web site behind it. For example, if home is a directory under this site, the code should be .

Other properties. The ALT, ALIGN, BORDER, Width, and height properties of the tag are optional. The Align property is the alignment of the image, with the parameter values Left, middle (center, right), border is the border of the image, its arguments are greater than or equal to 0, the default units are pixels, and the width and height properties are the width and height of the image. The default unit for the parameter is pixels; The Alt property is the text that is displayed when the mouse is moved to the image, reminding you to use the property when making the page, what is the purpose of this? Is the text that can be displayed when the image cannot be displayed for some reason, thus increasing the friendliness of the user.

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.