Rajitha
Rajitha

Reputation: 53

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>

Upvotes: 1

Views: 129

Answers (3)

Praveen
Praveen

Reputation: 1005

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

Upvotes: 1

Dhawal Mhatre
Dhawal Mhatre

Reputation: 435

First of all you have write this in external stylesheet, and you can mention

@media screen and (min-width:1250px) and (max-width:1350px)

Request you to trying using this

Upvotes: 1

Peter
Peter

Reputation: 1391

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>

Upvotes: 2

Related Questions