I have given the same font size(2em) to all divs. But the font size in #left
and #right
is obviously bigger. I have no idea why the browser gives this result.
Here's a code snippet:
div {
color: white;
font-size: 2em;
}
#header {
width: 100%;
height: 120px;
background: #99ff00;
}
#main {
width: 100%;
height: 400px;
background: #99ff99;
}
#left {
width: 30%;
height: 100%;
float: left;
background: #999999;
}
#right {
width: 70%;
height: 100%;
float: left;
background: #553344;
}
#footer {
clear: both;
width: 100%;
height: 80px;
background: #66ff66;
}
<div id="header">header</div>
<div id="main">
<div id="left">left</div>
<div id="right">right</div>
</div>
<div id="footer">footer</div>