In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you what the attributes of the IMG tag in HTML are, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
In HTML, images are made up of
Label definition.
Is an empty tag, meaning that it contains only attributes and does not have a closed tag.
To display the image on the page, you need to use the src attribute. Src means "source". The value of the source property is the URL address of the image.
The syntax for defining an image is:
URL refers to the location where the image is stored. If the image named "pulpit.jpg" is in the images directory of www.runoob.com, its URL is http://www.runoob.com/images/yidian.jpg.
The browser displays the image where the image label appears in the document. If you place the image tag between two paragraphs, the browser will first display the first paragraph, then the picture, and finally the second paragraph.
Definition and usage
The img element embeds an image into a web page.
Please note that technically speaking
The tag does not insert the image into the page, but links the image from the page.
The tag creates a placeholder for the referenced image.
Tags have two required attributes: the src attribute and the alt attribute.
Src attribute: specifies the URL that displays the image.
The alt property is used to define a string of prepared replaceable text for the image.
The value of the replacement text property is user-defined.
When the browser cannot load the image, replace the text attribute to tell the reader what information they have lost. At this point, the browser will display the alternative text instead of the image. It is a good habit to add replacement text attributes to all images on the page, which helps to better display information and is very useful for those who use plain text browsers.
Scaling of the HTMLimg property
HTML section:
Css controls image zooming:
.tuimg {
Max-height:720px
Max-width:640px
Width:_expression (this.width > 640&&this.height720?720:true)
}
Description: pictures larger than 640 automatically zoom to 640px, if less than 640px is the actual size, height is greater than 720px zoom to 720px, less than 720px is the actual size. Note: generally do not control the size of the picture.
The center display of the image: (with all alignment attribute values)
Left: align the image to the left
Right: align the image to the right
Middle: align the image with the center
Top: align the image to the top
Bottom: align the image to the bottom
Height,width attribute
The height and width properties are used to set the height and width of the image.
The default unit of the attribute value is pixels:
Tip: it is a good habit to specify the height and width of the image. If the image specifies a height width, the specified size is retained when the page is loaded. If you do not specify the size of the picture, it is possible to destroy the overall layout of the HTML page when the page is loaded.
Basic precautions-useful tips:
Note: if a HTML file contains ten images, 11 files need to be loaded in order to display the page correctly. It takes time to load pictures, so our advice is: use pictures carefully.
Note: when loading a page, pay attention to the path of inserting the page image. If the location of the image is not set correctly, the browser cannot load the image, and the image label will display a broken picture.
HTML Image label:
Define Ima
Define an image map
Define clickable areas in an image map
Differences between HTML and XHTML:
In HTML
The label does not have an end tag.
In XHTML
The label must be closed correctly.
In HTML4.01, the "align", "border", "hspace" and "vspace" attributes of the image element are not recommended.
In XHTML1.0StrictDTD, the "align", "border", "hspace" and "vspace" attributes of the image element are not supported.
[knowledge supplement]
Optional attributes in img:
Align: specifies how images are arranged according to the surrounding text.
Border: defines the border around the image.
Height: defines the height of the image.
Hspace: defines the white space on the left and right side of the image.
Ismap: defines an image as a server-side image mapping.
Longdesc: point to the URL that contains a long image description document.
Usemap: defines an image as a client-side image map.
Vspace: defines the white space at the top and bottom of the image.
Width: sets the width of the image.
The above is all the content of the article "what are the attributes of IMG tags in HTML?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.