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
WBOYOriginal
2016-05-16 12:03:352714browse

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

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