Home > Web Front-end > HTML Tutorial > Is img a double-tagged element in HTML?

Is img a double-tagged element in HTML?

王林
Release: 2023-01-03 09:28:43
Original
6161 people have browsed it

img is not a double-tab element in html. The img tag is a single tag used to define images in HTML pages. The img tag has two required attributes, the src attribute and the alt attribute.

Is img a double-tagged element in HTML?

The operating environment of this article: windows10 system, html 5, thinkpad t480 computer.

In html, the Is img a double-tagged element in HTML? tag is a single tag.

Tag introduction:

Is img a double-tagged element in HTML? tag defines images in HTML pages.

Is img a double-tagged element in HTML? tags have two required attributes: src and alt.

Commonly used attributes:

  • alt text Specifies the alternative text of the image.​

  • height pixels Specifies the height of the image.

  • src URL Specifies the URL for displaying the image.​

  • width pixels Specifies the width of the image.

Code example:

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>php中文网(php.cn)</title> 
</head>
<body>

<img src="smiley-2.gif" alt="Smiley face" width="42"    style="max-width:90%">

</body>
</html>
Copy after login

(Free video tutorial: html video tutorial)

Running result:

Is img a double-tagged element in HTML?

Related recommendations: html tutorial

The above is the detailed content of Is img a double-tagged element 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