Home  >  Article  >  Web Front-end  >  Teach you step by step how to use the img tag to add image effects (knowledge)

Teach you step by step how to use the img tag to add image effects (knowledge)

奋力向前
奋力向前Original
2021-07-29 16:21:025554browse

In the previous article "How to use HTML to create a simple and beautiful navigation bar (detailed code explanation)", we introduced how to use HTML to create a navigation bar. The following article will show you how to add image effects to the img tag. Let’s see how to do it together.

Teach you step by step how to use the img tag to add image effects (knowledge)

##Teach you step by step how to use the img tag to add image effects (knowledge) Tag

Teach you step by step how to use the img tag to add image effects (knowledge) is used to define images in web pages. We usually use Most images seen on web pages are defined with this tag.

Code example:

<img  src="https://img.php.cn/upload/image/682/458/838/1627535900680707.jpg"    style="max-width:90%"  style="max-width:90%" alt="Teach you step by step how to use the img tag to add image effects (knowledge)" >

The rendering is as follows:

Teach you step by step how to use the img tag to add image effects (knowledge)

Because the standard does not clearly state the image formats that the browser needs to support.

Common formats are widely supported

  • JPEG: high compression

  • GIF: dynamic pictures

  • PNG: lossless compressed bitmap graphics format

  • SVG: vector image

##Teach you step by step how to use the img tag to add image effects (knowledge)
    #SRC: Specify the image storage address and where to store it. Without this attribute, the browser will not know.
  • Width and Height: Specify the width and height of the image. It is recommended to use CSS to achieve this.
  • Recommended learning:
CSS video tutorial

The above is the detailed content of Teach you step by step how to use the img tag to add image effects (knowledge). 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