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

How to set pictures in html

藏色散人
Release: 2023-01-04 09:33:42
Original
10978 people have browsed it

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="上海鲜花港 - 郁金香" />
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template