首页 > 其他 > 详细

响应式-字体运用rem

时间:2015-05-11 19:43:20      阅读:235      评论:0      收藏:0      [点我收藏+]
<!doctype html>
<html>
<head>
    <title>aaa</title>
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> 
    <meta http-equiv="Pragma" content="no-cache" /> 
    <meta http-equiv="Expires" content="0" />      
    <style type="text/css">
        html {font-size: 62.5%;/*10 ÷ 16 × 100% = 62.5%*/}
        body {font-size: 1.4rem;/*1.4 × 10px = 14px */}
        p.bb { 
                font-size: 1.5rem;/*1.5 × 10px = 15px*/
                line-height:2em;/*基于字体大小的两倍高度 2*15=30px**/
             }
        p.aa { font-size: 15px;/*15px*/}
    </style>
</head>
<body>
你好啊
<p class="bb">你好啊nnn</p>
<p class="aa">你好啊nnn</p>
</body>
</html>

font-size rem 相比10px

line-height:2em 相比当前元素字体高度2倍

响应式-字体运用rem

原文:http://www.cnblogs.com/jdhu/p/4495346.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!