html - CSS 屏幕方向 WebApp 旋转
问题描述
试图将我的 WebApp HTML 锁定为 HTML5 视频的横向模式。已经找到了一个很好的解决方案,但是它将屏幕旋转到 -90 度,但我需要 +90 度...当我将 -90 更改为 90 时,视频播放器从屏幕上消失。我认为transform-origin
or 和top
orleft
是错误的。这里的CSS:
@media screen and (min-width: 320px) and (max-width: 767px) and (orientation: portrait) {
html {
transform: rotate(-90deg);
transform-origin: left top;
width: 100vh;
overflow-x: hidden;
position: absolute;
top: 100%;
left: 0;
}
}
任何的想法?
解决方案
尝试添加left:50px
......因为你已经给出了overflow-x:hidden
,你看不到它已经被左移了,因为加旋转..
@media screen and (min-width: 320px) and (max-width: 767px) and (orientation: portrait) {
html {
transform: rotate(90deg);
transform-origin: left top;
width: 100vh;
overflow-x: hidden;
position: absolute;
/*top: 100%;*/
left: 50px;
}
}
<html>
<head>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
检查它在提到的屏幕宽度(320px 到 767px)..
推荐阅读
- javascript - Acrobat X 中的 JavaScript:打印页面范围
- html - 为什么我的 justify-content: 不能开始为 Flexbox 工作?
- python - 美丽的汤发现没有返回
- javascript - 在嵌入我网站的 YouTube 视频之前添加自定义视频广告
- javascript - 在鼠标后面的画布元素中设置绘制的矩形碰撞
- mysql - 如何搜索内容但跳过方括号内的内容?
- python - 在 pyspark-2.3 中使用 python 内置函数 **abs** 时出错
- java - 如何通过断言失败
- php - addFromString():ziparchive 无效或未初始化
- ios - 声明数组时出现编译器错误:编译器无法进行类型检查...不同的子表达式