Search code examples
cssmedia-queriesdeviceresponsive

How can I apply a Media Query to both Height and Width?


How can I apply a Media Query to both the Height and With of the Device I am currently using this:

@media (min-width: 1366px) and (max-width: 1366px){

but I Need to apply it also to the Height of 768px...

I only want it to apply if the Resolution of the Device is 1366x768px!


Solution

  • @media (min-height: 768px) and (max-height: 768px) and (min-width: 1366px) and (max-width: 1366px) { ... }
    

    Here is the possible duplicate question:

    Media Queries: check min-height and min-width?

    Here are a few references from the question :

    First reference
    Second reference