wolf_22 — 2010-02-04T16:10:26-05:00 — #1
When you set a margin or padding percent value for an element, is this value determined by what dimensional value and unit the parent is made with?
Here's a VERY generic example...
If #block is using margin-top the way it is (with percentages), is this final margin value relative to its parent, #outer, or is it relative to its OWN width and height dimensions? The reason I ask this is because I tried a similar approach with something today and decided that it's time to figure out why, exactly, #block doesn't seem to be making the exact and precise space for #menu.
ryanreese — 2010-02-04T16:16:13-05:00 — #2
When you use percents on the margin/padding then it is relative to it's OWN WIDTH only. Not height. Not even if you do margin-top:100%. The computed value will be 100% of it's width.
For exmaple, if you did margin-top:50%; and the width on the element was 800px, it would move it down 400px
wolf_22 — 2010-02-04T16:30:50-05:00 — #3
ryanreese — 2010-02-04T16:33:56-05:00 — #4