[英]How does (orientation: landscape) really work in CSS Media Queries?
根據preffferd css語法,我正在應用Media Query,它沒有任何改變。 這不會給我任何更改的輸出。 救命。!
/* Landscape */
@media only screen
and (min-device-width: 320px)
and (max-device-width: 480px)
and (-webkit-min-device-pixel-ratio: 2)
and (orientation: landscape) {
.someClass{
display: none;
}
}
由於用法錯誤,因此沒有提供輸出。 您想將該屬性與HTML選擇器一起使用。
正確的語法:
/* Landscape */ @media only screen and (min-device-width: 320px) and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: landscape) { body { display: none; } }
@media only screen
and (min-device-width: 320px)
and (max-device-width: 480px)
and (-webkit-min-device-pixel-ratio: 2)
and (orientation: landscape) {
*{ display: none; }
}
試試這個,你沒有選擇任何隱藏的東西
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.