em 与 rem

2018-05-16  本文已影响0人  jh2k15
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
/*    html{
      font-size: 20px;
    }*/
/*    body{
      font-size: 20px;
    }*/
    .em{
      background: red;
      width:10em;
      height:10em;
      font-size: 20px;
    }
    .rem{
      background: blue;
      width:10rem;
      height:10rem;
      font-size: 20px;
    }
  </style>
</head>
<body>
    em
    <div class="em">

    </div>
    rem root element
    <div class="rem">

    </div>
</body>
</html>
上一篇 下一篇

猜你喜欢

热点阅读