admin管理员组文章数量:1430627
<input type="radio" class="list" checked> <!-- checked, desktop -->
<input type="radio" class="grid"> <!-- checked, mobile -->
Here class list is desktop and mobile. I know it is css media screen. How can I change the mobile is class grid and desktop is class list? Now it is only list on the first, both desktop and mobile.
<input type="radio" class="list" checked> <!-- checked, desktop -->
<input type="radio" class="grid"> <!-- checked, mobile -->
Here class list is desktop and mobile. I know it is css media screen. How can I change the mobile is class grid and desktop is class list? Now it is only list on the first, both desktop and mobile.
Share Improve this question asked May 27, 2019 at 17:29 DaniDani 214 bronze badges1 Answer
Reset to default 0If we suppose that you have mobile version with max resolution to 980px you can use media query with max width 980 for mobile. In this media query you stop list item to be displayed. On the other side on desktop where media have min resolution 981px, you will set the grid to not displayed.
<style>
@media screen and (max-width: 980px){
.list { display: none; }
}
@media screen and (min-width: 981px){
.grid{ display: none; }
}
</style>
本文标签: cssDesktop is class List and Mobile is class Grid
版权声明:本文标题:css - Desktop is class List and Mobile is class Grid 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745459053a2659238.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论