为什么这段代码会使两个 div 都出现在横向 iPad 上?
/* CSS */
div{
display:none;
}
@media screen and (min-width: 48em) {
/* IPAD PORTRAIT */
body {
/* DARK BLUE */
background-color:#006;
}
div{
display:none;
}
#ipad-portrait{
display:block;
}
}
@media screen and (min-width: 64em) {
/* IPAD LANDSCAPE */
body{
/*bright green*/
background-color:#3f0;
}
/* an attempt to hide all divs before displaying
the one that says iPad landscape */
div{
display:none;
}
#ipad-landscape{
display:block;
}
}
<!-- HTML -->
<div id="ipad-landscape">
ipad landscape
</div>
<div id="ipad-portrait">
ipad portrait
</div>
谢谢!