Home >Web Front-end >CSS Tutorial >Solution to the gap between img pictures inserted into li_CSS/HTML
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:
Method 2: Set container font-size:0 (I personally think this method is the best!!!)