IMG Compatibility issues There will always be gaps between CSS pictures and pictures

Source: Internet
Author: User

Solution:

Magic One: Define the picture img tag vertical-align:bottom,vertical-align:middle,vertical-align:top.

Img{vertical-align:bottom;}As for the HTML attribute align= "center" (for the picture browser will be processed into align= "middle") solution, is equivalent to vertical-align:middle; so the truth is the same, As long as the vertical-align does not take baseline, the void disappears.  Magic Weapon Two: the font size in the definition container is 0. Div {
width:110px;
border:1px solid #000000;
font-size:0
} It is said that the reason:inline elements, such as picture text, are aligned by default with the parent element's baseline, while baseline has a certain distance from the parent's bottom (the distance is related to font-size,font-family), so the vertical-align is set: Top/bottom/text-top/text-bottom can prevent this from happening. And not only Li, but also the other block elements include IMG in this phenomenon.

IMG Compatibility issues There will always be gaps between CSS pictures and pictures

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.