【问题标题】:how to get vw fonts to stop growing如何让大众字体停止增长
【发布时间】:2019-08-14 08:33:08
【问题描述】:

我正在尝试创建一个响应式网页,其中 html 的最大宽度为 1000 像素。我所有的字体都是用 vw 来指定的。当浏览器扩展到超过 1000px 时,有没有办法阻止字体增长?

【问题讨论】:

    标签: css wordpress responsive font-size


    【解决方案1】:

    您可以使用@media 规则:

    .text-class {
        font-size: 0.2vw;
    }
    
    @media only screen and (min-width: 1000px) {
        .text-class {
            font-size: /* some fixed size */;
        }
    }
    

    【讨论】:

      【解决方案2】:

      使用媒体查询

      .dynamic-size-text {
          font-size: 30px;
        }
      
      @media only screen and (max-width: 1000px) {
        .dynamic-size-text {
          font-size: 10vw;
        }
      }
      

      【讨论】:

        猜你喜欢
        • 2017-06-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-04-03
        • 1970-01-01
        • 2017-10-07
        • 2014-09-22
        • 1970-01-01
        相关资源
        最近更新 更多