Home > Web Front-end > HTML Tutorial > Invalid solution for setting img image height to percentage

Invalid solution for setting img image height to percentage

WBOY
Release: 2016-07-11 08:44:03
Original
2563 people have browsed it

When using percentage as the width and height, because the percentage is relative to the width and height of its nearest parent element, first its parent element must have a width and height. The width is generally not set and will have a default value (such as the width of the entire screen). However, if the height is not set, there will be no default value. Therefore, if the parent element does not set a height value and its internal element uses a percentage as the height, it will have no effect

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