這可能嗎?這對我來說似乎是一個很好的解決方案,但我不確定它是否會起作用。是否可以在媒體查詢中嵌套媒體查詢?
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Code for both portrait and landscape */
@media (orientation:portrait) {
/* Code for just portrait */
}
@media (orientation:landscape) {
/* Code for just landscape */
}
}
我喜歡這個主意,因爲它在技術上確實嵌套爲暗示。 –