Weird Invisible Margin Below Pictures
In this issue, the author encounters an invisible margin below images in their web page, despite the absence of such margin in the code. This is a common issue caused by the nature of images as inline elements.
According to the response, the default inline behavior of images creates space between the image's bottom, which aligns with the text baseline, and the bottom of the text line. To resolve this, the solution is to convert the image into a block element.
One simple solution is to use display: block; to achieve this. Another method is to float the image with float: left; or float: right;, which also transforms it into a block element.
Adjusting properties like vertical-align, font-size, and line-height may also influence the spacing but are less reliable and still susceptible to the effect in different contexts.
Related questions provided for further information include the following:
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3