Forums

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

Home Forums CSS Padding-Top:()em pushed h1 down too far.

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #37916
    dannygreen
    Member

    Hi Guys,
    I’m sure this is a silly question but here is my problem.

    I have a h1 that is part of a header, it is at the right hand side of a logo which is floated.
    I’m using margin-left:53% for the h1 and trying to work out what the em for the padding-top would be.

    I’ve worked out the em, and my calculations are correct; however, when I apply the em to padding-top it pushes
    the h1 down way more than it should.

    Any help would be appreciated.

    Thanks
    Danny

    #102272
    Senff
    Participant

    Any specific reason why you won’t just use pixels to move the H1 down somewhat and insist on using ems?

    Regardless, hard to figure out what the problem is without a live example, or not knowing how much you actually want the H1 to be pushed down.

    #102273

    Ems are a relative unit. What are you basing the calculation off, the font-size of the h1?

    #102294
    TheDoc
    Member

    I have a feeling it’s bigger because the h1 has bigger defaults.

    #102411
    dannygreen
    Member

    sorted it, I was working the em value out from the body font-size rather than that of the parent div. Thanks

    #102397

    Thought that might be the case. Glad it’s fixed!

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