Search code examples
cssmedia-queries

Media queries for responsive design


I'm trying to develope a website with the responsive design and I know that I have to use media queries, I used them and they work fine on my desktop (When I resize the window the look change). So I was wondering if there are some 'standard values' to use them with smartphones/tablet/desktop. I've looked at other questions but are too old.


Solution

  • A bit of searching on CSS a you may found this :

    http://getbootstrap.com/css/#grid-media-queries

    /* Extra small devices (phones, less than 768px) */
    /* No media query since this is the default in Bootstrap */
    
    /* Small devices (tablets, 768px and up) */
    @media (min-width: @screen-sm-min) { ... }
    
    /* Medium devices (desktops, 992px and up) */
    @media (min-width: @screen-md-min) { ... }
    
    /* Large devices (large desktops, 1200px and up) */
    @media (min-width: @screen-lg-min) { ... }
    

    Basically (if you read the comment lines), for classic CSS (meaning no less/sass), you would replace @screen-sm-min by 768px for instance. Or whatever fits you.