mercredi 7 octobre 2020

Why does my media queries not work even when it is written correctly

I am trying to set the media queries in my footer class but for some reason its not working.

Am running the server with Laravel 5 but am not sure that's what is causing this.

The image shows the HTML, CSS and the phone screen. Note that the screen width of the phone is above 450px, therefore the footer color should have turned red.

Here are the codes:

HTML

    <div class="footer d-flex justify-content-center">
        <span class="font-md text-light">Footer</span>
    </div>

CSS

.footer{
    background-color:rgba(40, 50, 60, 1);
    height: 200px;
}

/* MEDIA QUERIES */

/* if screen width goes above 450px do this */
@media only screen and(min-width: 450px)
{
    /* make the color red */
    .footer{
        background-color: red!important;
    }
}


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire