屏幕适配方法

原本的样式

#index-navigate ul li a {
    display: inline-block;
    width: 200px;
    height: 50px;
    text-decoration: none;
    color: white;
    line-height: 50px;
    font-size: 35px;
    margin: 0 8px;
    font-family: BebasNeue-webfont;
}

#index-content {
    margin-top: 100px;
    padding-top: 20px;
    text-align: center;
    background-color: white;
}

当屏幕宽度小于固定尺寸微调样式

@media screen and (max-width: 1101px){
    #index-navigate ul li a {
        width: 150px;
    }

    #index-content {
        margin-top: 80px;
    }
}

@media screen and (max-width: 851px){
    #index-navigate ul li a {
        width: 100px;
        height: 40px;
        line-height: 40px;
        font-size: 30px;
    }

    #index-content {
        margin-top: 60px;
    }
}

@media screen and (max-width: 610px){
    #index-navigate ul li a {
        width: 80px;
        height: 25px;
        line-height: 25px;
        font-size: 20px;
    }

    #index-content {
        margin-top: 40px;
    }
}

@media screen and (max-width: 501px){
    #index-navigate ul li a {
        width: 60px;
        height: 20px;
        line-height: 20px;
        font-size: 15px;
    }

    #index-content {
        margin-top: 30px;
    }
}

@media screen and (max-width: 401px){
    #index-navigate ul li a {
        width: 50px;
        height: 15px;
        line-height: 15px;
        font-size: 12px;
    }

    #index-content {
        margin-top: 20px;
    }
}

results matching ""

    No results matching ""