c12*_*c12 3 javascript iphone mobile android
当移动应用程序页面方向从横向更改为纵向时,更改css文件的最佳方法是什么,反之亦然.我只需要支持Android和iPhone.媒体查询似乎不是最干净的方式,其他任何想法?
例
/* For portrait */
@media screen and (orientation: portrait) {
#toolbar {
width: 100%;
}
}
/* For landscape */
@media screen and (orientation: landscape) {
#toolbar {
position: fixed;
width: 2.65em;
height: 100%;
}
p {
margin-left: 2em;
}
}
Run Code Online (Sandbox Code Playgroud)
有关详细信息,请参阅此处