Search code examples
cssmedia-queries

I want screen resolution at particular width in css?


I want red colour when my screen resolution is between 1250px to 1350px . Below is my code:

    <style>
    @media screen and (max-width: 1250px){
    .navigation .menu .sub-menu .sub-menu {
    background-color: red;    
     }
    }
    </style>

Solution

  • Not much magic. You pretty much just write down what you want to do:

    <style>
    @media screen and (min-width: 1250px) and (max-width: 1350px){
    .navigation .menu .sub-menu .sub-menu {
    background-color: red;    
     }
    }
    </style>