📜 ⬆️ ⬇️

Remove the extra padding at the bottom of the image.

Extra padding at the bottom of the image img1

Probably, many, when html-layout, met the "bug" when, placing two images in a block, a gap appears between them, about 3-5 pixels. This effect is present not only in the beloved IE6, but also in other browsers. Most solved it with tambourines - Doctype substitution, removing extra padding in the html file and so on.

Starting to look for a solution to the problem on the Internet, including on the habr, I realized that there were many questions about this, but most did not find the correct answer. As a result, it turned out that this is not a bug at all. IMG is an inline element, and therefore the vertical-align property is applied to it. In browsers, this property is set by default (on most baselines, if I'm not mistaken).
')
It is enough to apply vertical-align: bottom to the image and there will not be indentation at the bottom. In other cases there will be ambiguity, and browsers will behave at their discretion.

Remove extra padding at the bottom of the image img1

Source: https://habr.com/ru/post/51140/


All Articles