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

Is img a double-tagged element in HTML?

王林
王林Original
2021-03-09 15:50:396139browse

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>

(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!

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