How to target a specific screen size using @media media query?

后端 未结 5 851
夕颜
夕颜 2021-02-06 13:54

I am new to responsive design, I am toying with twitter bootstrap responsive.css now. And I am encountering some trouble with my project.

The trouble is, my left column

5条回答
  •  别跟我提以往
    2021-02-06 14:14

    Since you are using Bootstrap, use the default variables to target specific screen sizes:

    // Extra small screen / phone
    $screen-xs:                  480px !default;
    
    // Small screen / tablet
    $screen-sm:                  768px !default;
    
    // Medium screen / desktop
    $screen-md:                  992px !default;
    
    // Large screen / wide desktop
    $screen-lg:                  1200px !default;
    

    Example:

    @media (min-width: $screen-sm) and (max-width: $screen-md) {
        /*
         * styles go here
         */
    }  
    

提交回复
热议问题