When setting the font size in CSS, why not set the <body> to 6.25% so that the px and em units are the same?
I read now about how it is good practice to set the font <body>to 62.5%, so later you can use the "divide by 10" conversion from pixel units.
But I was wondering: why not set <body>at 6.25%? You can then use the same sizes for em units as for pixel blocks, provided that the default browser font size is 16 pixels.
eg.
body {
font-size: 6.25%; /* 1px */
}
p {
font-size: 12em; /* 12px */
}
+3
3 answers
Two problems.
, , , ems, Internet Explorer, .
, , IE, IE, .
, .
, , , , , ems,
font-size, , , -font-size, .: , ,
<li>12 .li { font-size: 12em;/* 12px */ }HTML-:
<ul> <li> <ul> <li> ...:
li li { font-size: .083em;/* 12px */ }<li>12 * 12 = 144 !. Ems , . , ems , .
<body>, , , em. ( , , - .)(, , , , IE , , . , .)
+5