2014-09-30 81 views
1

需要有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) {...}} 
+0

你到目前爲止嘗試過什麼?請張貼您的CSS代碼,而不僅僅是媒體查詢。 – 2014-09-30 07:31:03

+0

@media屏幕和(MAX-設備寬度:450像素){ \t IMG { \t \t顯示:無;} \t .ART { \t \t顯示:無;} – Darren 2014-09-30 07:33:24

+0

編輯你的信息以添加的CSS那裏。在未來的問題中,最好添加所有相關的代碼,以便人們提供有用的答案。謝謝! – 2014-09-30 07:35:22

回答

3

使用該媒體查詢。

@media screen and (max-device-width:450px) { 
 
#art img{ 
 
     display:none; 
 
    } 
 
}

我不正確地理解你的要求。如果它不是您需要的解決方案,請進一步解釋您的問題。 :) :)

0

對不起的,急忙我想寫這樣DEMO

@media screen and (max-width:450px){ 
    #art img{ 
     display:none; 
    } 
} 

or 

    @media screen and (max-width:450px){ 
     #art img{ 
      visibility: hidden; 
     } 
    } 
0

你說這個?

@media screen and (max-device-width:450px){ 
    #art img{ 
     display:none; 
    } 
} 
0
@media screen and (max-device-width:450px) { .art img { display: none !important;} 
0

您可以隱藏整個DIV #art { display:none; }或添加類的形象。或者隱藏在div的圖像與#art img { display:none; }

我只想用屏幕寬度,像這樣:

@media screen and (max-width:450px) { 
    #art {   
    display:none; 
    } 
}