我有一个问题。这是我的测试网站。 Test Website 问题是,当我在任何 iPad 模拟器中查看时,比如 iPad Peek或原始 ipad,出现我不想要的垂直滚动条。我希望我的页面完全适合高度。这本书应以完整形式出现,没有卷轴。有人可以帮忙吗?
最佳答案
使用css3媒体查询检测并实现viewport
/* iPads (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px) {
/* Styles */
}
/* iPads (landscape) ----------- */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : landscape) {
/* Styles */
}
/* iPads (portrait) ----------- */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : portrait) {
/* Styles */
}
Reference: http://stuffandnonsense.co.uk/blog/about/hardboiled_css3_media_queries
关于css - 检测和调整 ipad 中的视口(viewport),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7712187/