HTML media query min AND max value

Viewed 187

This is my current code:

<link rel="stylesheet" href="mobile.css" media="screen and (max-width: 750px)">

Is there an option to have a min AND a max query?

I tried media="screen and (min-width: 250px), screen and (max-width: 750px)" but it didn't work.

Is there a solution for this?

3 Answers

I think you need this way

Make a file for styles route and import other the style file in the @media for any size

example :

@media only screen and (max-width: 750px) {
   @import "./example.css";
}

In style.css there should be a query like this.

Example: on screens that are 600px or less, set the background color to olive

@media screen and (max-width: 600px) {
  body {
    background-color: olive;
  }
}

You can use simply like this.

    @media only screen and (min-device-width: 767px) and (max-device-width: 1024px) {
    /*  your code here */
    }
Related