zoukankan      html  css  js  c++  java
  • em,rem

    em rem 相对单位:  也可用于设置padding line-height等
    em相对当前容器的默认字体设置
    比如,所有浏览器默认字体都是16px,body{ font-size:62.5%}
    以后即1em=10px; 1.2em=12px
    在线转换tool: http://pxtoem.com/

    em(css2.0) rem(css3.0)

    rem相对于页根元素的字体大小,即 html 元素的字体大小
    比如:html{font-size:16px;} 10rem=160px;
    配合 使用media query 设置html的font-size;

    html{font-size:10px}
    @media screen and (min-321px) and (max-375px){html{font-size:11px}}
    @media screen and (min-376px) and (max-414px){html{font-size:12px}}
    @media screen and (min-415px) and (max-639px){html{font-size:15px}}
    @media screen and (min-640px) and (max-719px){html{font-size:20px}}
    @media screen and (min-720px) and (max-749px){html{font-size:22.5px}}
    @media screen and (min-750px) and (max-799px){html{font-size:23.5px}}
    @media screen and (min-800px){html{font-size:25px}}

  • 相关阅读:
    sql-DDL, DML 常用语句
    7.8 Structured Streaming
    7.7 输出操作
    7.6 转换操作
    7.5 高级数据源---Kafka
    7.4 基本输入源
    7.3 DStream操作
    7.2 Spark Streaming
    7.1 流计算概述
    6.3 使用Spark SQL读写数据库
  • 原文地址:https://www.cnblogs.com/isdom/p/webclips036.html
Copyright © 2011-2022 走看看