Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Aligning text flush to the top left of a div.

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #36125
    desttE
    Member

    Hey,

    I have been battling to align text to the top of a div without there being a bit of extra margin space I can’t seem to get rid of.

    My post title, is not inline with my logo on the far left hand side.

    Have a look here…

    Any advice would be greatly appreciated. :)

    Thanks.

    #94623
    Billy
    Participant

    Have you tried giving the div 0 padding and the text 0 margin? That usually works to me.

    #94628
    desttE
    Member

    Yeah. :(

    #94636
    Billy
    Participant

    I think you’ll have to give the text a negative margin then, by about a pixel or something.

    #94650
    desttE
    Member

    Thanks guys.

    Was hoping to get pixel perfect aligment but as you’ve said wolfcry911, it’s not going to be possible. :(

    #94690
    TheDoc
    Member

    Add line-height: 1; to .posttitle a

    #94715
    desttE
    Member

    TheDoc: That helped quite a bit. :) Thanks. Is this the most pixel precise I’m going to be able to get my post title?

    #94734
    TheDoc
    Member

    Most likely, yea. You might notice that some browsers will render it slightly differently as well.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘CSS’ is closed to new topics and replies.