zoukankan      html  css  js  c++  java
  • Bootstrap如何配合字体自适应

    Bootstrap框架中,字体不会自适应,及时使用rem都不行,那么就只有使用媒体查询来做。这样可能会有点麻烦,但是这是我目前找到的一个方法直接上代码了

    div {
        font-size: 12px;
        -webkit-transition: font-size 0.2s ease-out;
    }
    
    @media only screen and (max- 1200px) {
        div {
            font-size: 39px;
        }
    
        .hb-size {
            font-size: 39px;
        }
    
        .ft-num {
            font-size: 38px;
        }
        .hb-num {
            font-size: 37px;
        }
        .hb-info
        {
            font-size: 12px;
        }
    }
    
    @media only screen and (max- 1100px) {
        div {
            font-size: 38px;
        }
    
        .hb-size {
            font-size: 38px;
        }
    
        .hb-num {
            font-size: 37px;
        }
        .hb-info
        {
            font-size: 12px;
        }
    }
    
    @media only screen and (max- 1000px) {
        div {
            font-size: 37px;
        }
    
        .hb-size {
            font-size: 37px;
        }
    
        .hb-num {
            font-size: 36px;
        }
        .hb-info
        {
            font-size: 12px;
        }
    }
    
    @media only screen and (max- 900px) {
        div {
            font-size: 36px;
        }
    
        .hb-size {
            font-size: 36px;
        }
    
        .hb-num {
            font-size: 35px;
        }
        .hb-info
        {
            font-size: 12px;
        }
    }
    
    @media only screen and (max- 800px) {
        div {
            font-size: 35px;
        }
    
        .hb-size {
            font-size: 35px;
        }
    
        .hb-num {
            font-size: 34px;
        }
        .hb-info
        {
            font-size: 12px;
        }
    }
    
    @media only screen and (max- 700px) {
        div {
            font-size: 30px;
        }
    
        .hb-size {
            font-size: 30px;
        }
    
        .hb-num {
            font-size: 29px;
        }
        .hb-info
        {
            font-size: 12px;
        }
    }
    
    @media only screen and (max- 600px) {
        div {
            font-size: 20px;
        }
    
        .hb-size {
            font-size: 22px;
        }
    
        .hb-num {
            font-size: 21px;
        }
        .hb-info
        {
            font-size: 12px;
        }
    }
    
    @media only screen and (max- 500px) {
        div {
            font-size: 22px;
        }
    
        .hb-size {
            font-size: 17px;
        }
    
        .hb-num {
            font-size: 13px;
        }
        .hb-info
        {
            font-size: 12px;
        }
    }
    
    @media only screen and (max- 400px) {
        div {
            font-size: 19px;
        }
    
        .hb-size {
            font-size: 15px;
        }
    
        .hb-num {
            font-size: 12px;
        }
        .hb-info
        {
            font-size: 12px;
        }
    }
    
    @media only screen and (max- 320px) {
        div {
            font-size: 16px;
        }
    
        .hb-size {
            font-size: 12px;
        }
    
        .hb-num {
            font-size: 12px;
        }
        .hb-info
        {
            font-size: 12px;
        }
    }
  • 相关阅读:
    leetcode 350. Intersection of Two Arrays II
    leetcode 278. First Bad Version
    leetcode 34. Find First and Last Position of Element in Sorted Array
    leetcode 54. Spiral Matrix
    leetcode 59. Spiral Matrix II
    leetcode 44. Wildcard Matching
    leetcode 10. Regular Expression Matching(正则表达式匹配)
    leetcode 174. Dungeon Game (地下城游戏)
    leetcode 36. Valid Sudoku
    Angular Elements
  • 原文地址:https://www.cnblogs.com/LoveQin/p/8818293.html
Copyright © 2011-2022 走看看