需要有IMG消失的时候我正在浏览的移动设备如何使用max-device-width调整大小时隐藏图像?
<div id="art">
<img src="../images/canO.jpg" alt="" width="500" height="500"/>
</div>
@media screen and (max-device-width:450px) {...}}
需要有IMG消失的时候我正在浏览的移动设备如何使用max-device-width调整大小时隐藏图像?
<div id="art">
<img src="../images/canO.jpg" alt="" width="500" height="500"/>
</div>
@media screen and (max-device-width:450px) {...}}
使用该媒体查询。
@media screen and (max-device-width:450px) {
#art img{
display:none;
}
}
我不正确地理解你的要求。如果它不是您需要的解决方案,请进一步解释您的问题。 :) :)
对不起的,急忙我想写这样DEMO
@media screen and (max-width:450px){
#art img{
display:none;
}
}
or
@media screen and (max-width:450px){
#art img{
visibility: hidden;
}
}
你说这个?
@media screen and (max-device-width:450px){
#art img{
display:none;
}
}
@media screen and (max-device-width:450px) { .art img { display: none !important;}
您可以隐藏整个DIV #art { display:none; }
或添加类的形象。或者隐藏在div的图像与#art img { display:none; }
我只想用屏幕宽度,像这样:
@media screen and (max-width:450px) {
#art {
display:none;
}
}
你到目前为止尝试过什么?请张贴您的CSS代码,而不仅仅是媒体查询。 – 2014-09-30 07:31:03
@media屏幕和(MAX-设备宽度:450像素){ \t IMG { \t \t显示:无;} \t .ART { \t \t显示:无;} – Darren 2014-09-30 07:33:24
编辑你的信息以添加的CSS那里。在未来的问题中,最好添加所有相关的代码,以便人们提供有用的答案。谢谢! – 2014-09-30 07:35:22