htmlHow to set the image: First create an HTML sample file; then insert an image into the html page through the "" method Just a picture.
The operating environment of this article: Windows7 system, HTML5&&CSS3 version, DELL G3 computer
html setting image example
In the following example, we insert into the page a photo of tulips taken by W3School engineers at Shanghai Flower Port:
<img src="/i/eg_tulip.jpg" alt="上海鲜花港 - 郁金香" />
The effect of the above code:
iHTML tag introduction
The img element embeds an image into a web page.
Please note that technically the tag does not insert an image into the web page, but rather links the image from the web page. The tag creates a placeholder for the referenced image.
tag has two required attributes: src attribute and alt attribute.
Differences between HTML and XHTML
In HTML, the tag does not have a closing tag.
In XHTML, the tag must be closed properly.
In HTML 4.01, the use of the "align", "border", "hspace" and "vspace" attributes of the image element is deprecated.
In XHTML 1.0 Strict DTD, the "align", "border", "hspace" and "vspace" attributes of the image element are not supported.
Recommended learning: "HTML video tutorial" "css video tutorial"
The above is the detailed content of How to set pictures in html. For more information, please follow other related articles on the PHP Chinese website!