html - div在旋转时掉出位置
问题描述
我制作了一个模拟时钟,div
与其他 2 个共享 1 个父空间divs
:
.left {
vertical-align: top;
width: 27%;
overflow: hidden;
display: inline-block;
}
#picLeft {
height: 100%;
width: 100%;
}
.container {
vertical-align: top;
position: relative;
display: inline-block;
width: 16.7%;
}
.clock {
vertical-align: top;
width: 100%;
height: 100%;
position: relative;
display: inline-block;
}
.hands {
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.hands-cl {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
vertical-align: top;
}
.right {
vertical-align: top;
width: 52.2%;
height: 100%;
overflow: hidden;
display: inline-block;
}
.picRight {
width: 100%;
height: 100%;
}
<div class="header-logo">
<div class="left">
<img id="picLeft" src="TIDleft.png">
</div>
<div class="container">
<div class="clock">
<img class="hands" src="TidClockFace.png">
<img id="hourHand" class="hands-cl" src="hourHand.png">
<img id="minuteHand" class="hands-cl" src="hourHand.png">
</div>
</div>
<div class="right">
<img class="picRight" src="TIDright.png">
</div>
</div>
这就是发生的事情:
如您所见,这看起来很荒谬。我不知道问题出在旋转还是图像大小上,因为divs
缩小图像以适合网站的一部分。这是我坚持寻找答案的第三天。没有 stackoverflow 线程是相似的,我已经用完了搜索词的想法。我希望这个问题被正确地提出,并且已经提供了足够的信息。如果不是,请不要犹豫,要求或纠正我。
解决方案
推荐阅读
- java - Test result is not as expected
- flutter - 显示 CircularProgressIndicator() 后无法调用 setState()
- c++ - C++ 命名空间中的字符串声明
- linux - 如何在bash中增加或减少一个值
- javascript - 如何仅重新加载 html 页面的一部分
- java - 如何根据配置文件加载一个或另一个 bean?
- altair - 如何替换 altair 中的工具提示标签?
- mongodb - IndexError:从空的双端队列 mongoengine/pymongo 弹出
- javascript - 类型'可观察的
' 不可分配给类型 'Observable ' - python - 阻止 django allauth 默认注册/登录 url