how do i include css based on screen size of the device

后端 未结 4 1956
有刺的猬
有刺的猬 2020-12-18 11:29

How do i include css based on the screen size of the devices for viewing web pages?

What i have in mind is that i will only include one css inside a page and inside

4条回答
  •  春和景丽
    2020-12-18 12:00

    You can try this for different screes size to use different css style

    /* min size style*/
    @media screen and (max-width:320px) {
       /* put your css style in there */
    }
    
    /* middle size style */
    @media screen and (min-width:321px) {
       /* put your css style in there */
    }
    
    /* large size style */
    @media screen and (min-width:800px) {
       /* put your css style in there */
    }
    

提交回复
热议问题