Search code examples
htmlcssmedia-queries

HTML media query min AND max value


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?


Solution

  • 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";
    }