Forum Moderators: not2easy

Message Too Old, No Replies

font-size affects border-width?

global font-size shows up in div border-width

         

D_Blackwell

3:04 am on Nov 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I was playing around with a layout and for no particular reason set the large font-size in the body selector of my declarations:

body {
margin: 0; padding: 0; background: #faebd7 url(wool-bg.jpg);
font: 700 3em Geneva, sans-serif;
}
#header {
width: 1800px; height: 125px; border: .3em solid #000;
}

The result was that the border-width in #header became huge. My question is why. I can't believe that I've not encountered this before. I tried moving the font-size to the division and it also blew up the border. What am I missing? Does font-size affect border-width?

choster

4:10 am on Nov 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You're setting your border to 0.3em, which was previously set to 3em (300%) of the base font. Anything styled with em will be affected by the inherited font size.