font-size:100% 原因

The browser default which is something like 16pt for Firefox, You can check by going into Firefox options, clicking the Content tab, and checking the font size. You can do the same for other browsers as well.
 

I personally like to control the default font size of my websites, so in a CSS file that is included in every page I will set the BODY default, like so:

body {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 14px}

让所有div字体相对body变大10%:

div {
    font-size: 110%}

让所有div字体相对body变小10%:

div {
    font-size: 90%}

This will make all divs have a font-size of 12.6px.

字体是会继承的属性,百分比相对于父元素,嵌套会影响里面的:

<div>Outer DIV.
    <div>Inner DIV</div></div>

The inner div will have a font-size of 11.34px (90% of 12.6px), which may not have been intended.

 

posted on 2016-01-27 14:18  迷茫小飞侠  阅读(299)  评论(0编辑  收藏  举报

导航