SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast thehung1724's Avatar
    Join Date
    Sep 2013
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Why does vertical middle can remove whitespace after image images?

    I don't understand why white space after my image is removed when i add a vertical:middle style. Can anyone explain this to me?

    Here is my code:

    Code:
    http://codepen.io/thehung1724/pen/nkavd

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,369
    Mentioned
    180 Post(s)
    Tagged
    6 Thread(s)
    Images are placed by default on the baseline not the bottom (just as text is) which leaves room underneath for descenders and so that the bottom of the image is at the bottom of the text (bar the descender). When you change the vertical-alignment to middle then it is no longer on the baseline and the gap underneath disappears.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •