Html syntax study NOTE 2: html syntax study note
1. image tags () and source attributes (Src)
In HTML, the image is defined by the label.
is an empty tag, meaning that it only contains attributes and does not close tags.
To display images on the page, you need to use the source attribute (src ). Src indicates "source ". The source attribute value is the image URL.
Syntax for defining images:
A URL is the location where the image is stored. If an image named "boat.gif" is located in the images directory of www.w3school.com.cn, its URL is http://www.w3school.com.cn/images/boat.gif.
The browser displays the image where the Image Tag appears in the document. If you place the Image Tag between two paragraphs, the browser will first display the first paragraph, then the image, and finally the second paragraph.
Replace text attributes (Alt)
The alt attribute is used to define a string of prepared replaceable texts for an image. The value of the Replace text attribute is user-defined.
When the browser cannot load images, replacing the text property tells readers what information they lose. In this case, the browser displays the alternative text instead of the image. Adding Replace text attributes to images on the page is a good habit, which helps to better display information and is very useful for those who use plain text browsers.
Basic Considerations-useful tips:
If an HTML file contains ten images, 11 files need to be loaded to display the page correctly. Loading images takes time, so we suggest using images with caution.
Note:
.../Indicates the upper-level directory of the directory where the source file is located,.../indicates the upper-level directory of the directory where the source file is located, and so on.
2,
Copyright Disclaimer: Author: jiankunking Source: http://blog.csdn.net/jiankunking this article copyright to the author and CSDN a total, welcome to reprint, but without the author's consent must retain this statement, and in the Article Page clearly given the original connection.