- This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
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
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.
Ems are a relative unit. What are you basing the calculation off, the font-size of the h1?
I have a feeling it’s bigger because the h1 has bigger defaults.
sorted it, I was working the em value out from the body font-size rather than that of the parent div. Thanks
Thought that might be the case. Glad it’s fixed!