html – Media queries on mobile do not work even after viewport meta tags

I realize it’s a duplicate, but the solutions I’ve tried don’t work. For some reason, after adding viewport meta tags, my media queries do not work on mobile. Does anyone know why?

This code is:

@media only screen and (max-width: 1260px) {
    .container {
        margin-top: 300px;
    }

    h2 {
        font-size: 3vw;
        width: 800px;
    }

    p {
        font-size: 2.5vw;
        width: 800px;
    }
}

@media only screen and (max-width: 550px) {
    h2 {
        width: 330px;
        font-size: 5vw
    }

    p {
        font-size: 4vw;
        width: 330px;
    }
}

Thanks.

Add a Comment

Your email address will not be published. Required fields are marked *