|
| |
|
|
Nicole
Posts: 2845 Joined: 9/15/2004 From: Nambucca / Kempsey, Australia Status: offline
|
Inconsistent padding... - 5/15/2006 18:06:37
This isn't really a question so to speak, but I've been using ems instead of pixels to set padding, margins etc where possible. I had a 3 paragraphs with 3 headings, both the <p> and <h2> tags had: padding: 0 0 0 1em; and oddly, the heading was ever so slightly more "indented" than the paragraph. Upon changing both of them to: padding: 0 0 0 16px; both the headings and paragraphs line up exactly. Shouldn't they do this anyway? Nicole
_____________________________
|
|
|
|
Tailslide
Posts: 6267 Joined: 5/10/2005 From: Out here on the raggedy edge Status: offline
|
RE: Inconsistent padding... - 5/15/2006 18:18:14
Far as I know - ems is relative to the font-size you're using- a heading would have a bigger font-size and would therefore 1em would be bigger than for a paragraph with smaller font. You could try using % if you prefered - but I'd say that if you're using a fixed layout then stick to px for margins/padding. Don't quote me on this but I seem to remember reading somewhere of a Guru's technique concerning this where they use % for horizontal margins and ems for vertical - which would get around this problem. If you particularly want to use ems for padding/margins then apply them to the div rather than the stuff inside them - but watch out for box model issues if you do that.
_____________________________
"My strategy is so simple an idiot could have devised it" Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project
|
|
|
|
Tailslide
Posts: 6267 Joined: 5/10/2005 From: Out here on the raggedy edge Status: offline
|
RE: Inconsistent padding... - 5/15/2006 18:39:45
Assuming that you've stuck to 100% font size (which you probably haven't - but it's easier to explain) then your paragraph text would be 16px in IE (different in other browsers). So 1em padding applied to that paragraph would move the paragraph inwards the same amount as if you applied 16px padding. The heading for instance might be equivalent to 24px for instance. So applying 1em padding to the heading would mean the same as applying a padding of 24px to it - thus moving it further in.
_____________________________
"My strategy is so simple an idiot could have devised it" Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|