【问题标题】:CSS Screen Orientation WebApp RotationCSS 屏幕方向 WebApp 旋转
【发布时间】:2018-11-13 09:52:06
【问题描述】:

试图将我的 WebApp HTML 锁定为 HTML5 视频的横向模式。 已经找到了一个很好的解决方案,但是它将屏幕旋转到-90度,但我需要+90度... 当我将 -90 更改为 90 时,视频播放器会从屏幕上消失。 我认为transform-origin 或top 或left 是错误的。 这里是 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;
    }
}

有什么想法吗?

【问题讨论】:

  • 你能发布工作副本吗?

标签: html css transform css-transforms


【解决方案1】:

尝试添加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)中检查它..

【讨论】:

  • 它的工作,可以看到部分播放器的肖像模式,我的css显示完整播放器,我认为它必须设置为top0或其他东西
  • 如果觉得有用别忘了采纳答案
  • 感谢您的赞赏 :)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-09-17
  • 2023-03-04
  • 2012-11-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多