Give help. Get help.

  • # April 24, 2013 at 11:12 am

    I’d like my text to align perfectly with the top of my images, but I believe line-height is impacting this. Here is an example of a left-aligned image: []( “”)

    I threw it into CodePen to better illustrate the CSS and markup: []( “”)

    Any pointers?

    # April 24, 2013 at 11:31 am

    I wouldn’t necessarily structure it that way but whatever your line height is, say 2em then there is 1em of space to be divided between the the area above and below the line.

    Therefore, add half of that as top margin to the image and it should line up…at least close enough.

    # April 24, 2013 at 11:36 am

    To me a ‘post’ would have a wrapping div which could then contain an image and the text.





    In the Codepen you can see that because the image is floated it pops out of the paragraph (add a border to the p to see it).

    I guess I’m just used to doing it that way….not saying it’s better.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.