CSS-Remove picture img Bottom-side blank gap

Source: Internet
Author: User

1. There is a gap at the bottom of the picture
<!DOCTYPE html>

2. Principle

An inline block element, such as a picture or form, whose bottom line is aligned with the baseline of the parent box (that is, the default vertical-align:baseline). This creates the problem that there is a blank gap in the bottom side of the picture.

3. Workaround

3.1 Method One: Vertical-align:top | Bottom | Middle
3.2 Method Two: Convert inline elements or inline block elements to block-level elements

4. Ps:vertical-align

Vertical-align does not affect the alignment of content in block-level elements, it is only for inline elements or inline block elements, especially inline block elements, and is typically used to control the alignment of pictures/forms to text.

CSS-Remove picture img Bottom-side blank gap

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.