Home > Web Front-end > CSS Tutorial > Solution to the gap between img pictures inserted into li_CSS/HTML

Solution to the gap between img pictures inserted into li_CSS/HTML

WBOY
Release: 2016-05-16 12:03:35
Original
2731 people have browsed it

Add style directly img{vertical-align:bottom; display:block}

Of course, it doesn't work in some cases. For example, I want to add three pictures, top, middle and bottom. The middle picture is set as the background. I found that this method is invalid. It's just that the gaps between the top and middle pictures are gone, and the bottom and middle pictures are gone. There is still something in between. The method is very simple. Change vertical-align:bottom to top. You can set the parameters of vertical-align according to the different situations you encounter.

Method 1:

Copy code The code is as follows:

img{vertical-align:top; display:block }

Solution to the gap between img pictures inserted into li_CSS/HTML

Copy code The code is as follows:


Method 2: Set container font-size:0 (I personally think this method is the best!!!)

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