Display content only on mobile devices

后端 未结 4 1059
不思量自难忘°
不思量自难忘° 2021-01-27 05:46

been working with media queries recently and for some reason unknown to me this doesn\'t work?

The idea is to only display the content on mobile devices. IE phones and

4条回答
  •  闹比i
    闹比i (楼主)
    2021-01-27 06:13

    Basically the viewport dimension for mobile phones and tablets fall under media query of (max-width: 991px), so you can update your code this way.

    @media (max-width: 991px) { 
       .mobileShow {display: block;}
    }
    

    However, some tablets have dimensions of 1024px width, so if you want to include them as well, you can use this code.

    @media (max-width: 1024px) { 
       .mobileShow {display: block;}
    }
    

提交回复
热议问题