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.

 

转载于:https://www.cnblogs.com/chuangweili/p/5163095.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值