我需要显示在不同屏幕尺寸不同的元素 - 手机,iPad和桌面”媒体查询显示在桌面上,iPad的不同元素,移动
此刻我:
@media only screen and (min-width: 480px) {
.showMobile {
display: none;
position: relative;
width: 100%;
}
}
@media only screen and (max-width: 480px) {
.hideMobile {
display: none;
}
}
,但我需要showTablet的肖像工作 - 横向屏幕尺寸
和
一个showDekstop显示桌面屏幕尺寸的桌面视图。
但我似乎无法得到这个工作......任何人都可以帮忙吗?
@media only screen and (min-device-width : 768px) and (max-device-width :
1024px) {
.showTablet {
display: block;
visibility: visible;
position: relative;
width: 100%;
}
}
@media only screen and (min-width: 1024px)and (max-device-width : 2048px) {
.showDesktop {
display: block;
visibility: visible;
position: relative;
width: 100%;
}
}
这是我有,但它不工作
到目前为止,您的** showDekstop **和** showTablet **的代码是什么?在桌面和平板电脑的代码中添加了 –