Home >Web Front-end >Front-end Q&A >How to set image height with css

How to set image height with css

藏色散人
藏色散人Original
2021-04-25 09:03:554360browse

How to set the height of the image in css: first create a new HTML file and introduce the image; then set the height of the image to "height:auto" or "height:30%"; finally check the effect of changing the height of the image. Can.

How to set image height with css

The operating environment of this article: Windows7 system, HTML5&&CSS3 version, Dell G3 computer.

css: Use percentage to set the height of the image

New HTML file

How to set image height with css

Introduce the image

How to set image height with css

The preview effect is as shown

How to set image height with css

Set the height of the image height: auto

How to set image height with css

Set the height of the image height: 30%

How to set image height with css

Set the height of the image height: 10%

How to set image height with css

Preview effect As shown in the picture

How to set image height with css

[Recommended learning: css video tutorial]

The above is the detailed content of How to set image height with css. 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