我可以强制iPad只在横向模式下显示网站吗
Can I force iPad to show website only in Landscape mode?
我想强制iPad只在横向模式下显示网站吗?
这可能吗?
您可以使用CSS:进行设置
@media only screen and (orientation:portrait){
html body * {
display:none;
}
}
@media only screen and (orientation:landscape){
/* your CSS */
}
在门户模式下,所有元素都将被隐藏。您可以将<div>Switch to landscape</div>
设置为仅在门户模式中显示
Safari的界面仍将处于人像模式,并且在将高度设置为100%时存在问题,但在人像模式下,您可以旋转整个html元素,如
html, body {
height: 100%;
}
@media screen and (orientation: portrait){
html {
-webkit-transform: translateY(-100%) rotate(90deg);
transform: translateY(-100%) rotate(90deg);
-webkit-transform-origin: left bottom;
transform-origin: left bottom;
}
}
或者查看http://codepen.io/ckuijjer/full/Frosl
相关文章:
- 缩略图单击时图像未以模式显示
- 模式显示文本区域内容不是字符串
- 在ajax回调(safari)中调用bootstrap模式显示
- Twtitter Bootstrap模式显示事件多次触发
- 以引导模式显示表单结果
- 引导模式显示,但没有可见文本
- 无法在提交时获取引导模式显示
- 提交表单后,将引导模式显示为“谢谢”
- 使用reactjs、localStorage和state(遍历)以模式显示表中的数据
- XPages-以读取模式显示附件
- JavaScript在验证后切换模式显示
- Jquery Cookie通过模式显示/隐藏菜单
- Rails Rendering从索引页以Bootstrap模式显示
- 强制网站仅以横向模式显示
- 如何使用单一模式显示多个图像
- 链接JavaScript不工作时,Bootstrap模式显示
- 引导模式显示不会移除隐藏属性
- Google Maps API v3 + Foundation 4 Reveal模式显示不正常
- 引导模式显示和隐藏在操作中
- 将JqGrid列模式显示为日期,超链接显示NAN/NAN/NAN