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--
This article mainly introduces the html img tag how to use the relevant knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe that everyone after reading this html img tag how to use the article will have a harvest, let's take a look.
The img tag of html can be used to display an image on a web page. It is an empty tag that contains only attributes and no closing tag.
Attributes of the img tag
The img tag can contain: src attribute, height and width attribute, alt attribute. The src attribute and the alt attribute are important attributes of the HTML img tag.
Let's take a look at these attributes of the img tag in detail:
1. Src attribute
The src property is a necessary property that describes the source or path of the image, indicating where the browser looks for the image on the server.
So get the image? There are two situations:
1) get the images in the same folder
When the HTML file and the image are in the same folder, like this:
We can enter the image name directly in the src attribute, such as:
one
two
three
four
Img tag
Effect picture:
2), in another directory / folder, such as:
You can access the image like this:
one
two
three
four
Img tag
The effect picture is like the picture above.
If it's more complicated, when we put the image of 1.jpg in the local disk E-> img folder, we can display the picture like this:
one
< img src="E:/img/1.jpg">2. Height and width properties
The height and width attributes of the img tag can be used to set the height and width of the image, for example:
one
Effect picture:
The height and width of the img tag image can also be set through css, for example:
one
two
three
four
Img {
Width:450px
Height:300px
}
3. Alt attribute
When the image cannot be displayed on the browser, you can use the alt property to display alternate text.
Ex.: I want to display 1.jpg pictures, but there is no one in the folder
one
two
Img tag
Effect picture:
This is the end of the article on "how to use the img tag of html". Thank you for reading! I believe that everyone has a certain understanding of the knowledge of "how to use the img tag of html". If you want to learn more, you are 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.