h3有滚动行为

问题描述 投票:0回答:1

不知为什么,我的 h3 元素想要滚动。我试着测试了一下,似乎是在这段代码中。

* {
  margin: 0px;
  padding: 0px;
  box-sizing: border-box;
  overflow-x: hidden;
}

html,
body {
  height: 100%;
  width: 100%;
}

.model-detail-caption {
  font-family: "Oswald";
  font-size: 5rem;
  font-weight: 700;
  color: #fff;
  position: absolute;
  bottom: 20%;
  left: 20px;
  width: 100%;
  border-left: 4px solid var(--accent);
  padding: 0px 0px 0px 10px;
}
<h3 class="model-detail-caption">Some Text</h3>
html css
1个回答
0
投票

position: absolute; bottom: 20%; left: 20px; 会导致这种行为。

© www.soinside.com 2019 - 2024. All rights reserved.