" method."/> " method.">

Home  >  Article  >  Web Front-end  >  How to set pictures in html

How to set pictures in html

藏色散人
藏色散人Original
2021-04-01 10:37:4010951browse

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.

How to set pictures in html

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:

How to set pictures in html

iHTML How to set pictures in html tag introduction

The img element embeds an image into a web page.

Please note that technically the How to set pictures in html tag does not insert an image into the web page, but rather links the image from the web page. The How to set pictures in html tag creates a placeholder for the referenced image.

How to set pictures in html tag has two required attributes: src attribute and alt attribute.

Differences between HTML and XHTML

In HTML, the How to set pictures in html tag does not have a closing tag.

In XHTML, the How to set pictures in html 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.

How to set pictures in html

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:How to set hr in htmlNext article:How to set hr in html