gpt4 book ai didi

html - 我在滚动时遇到困难

转载 作者:行者123 更新时间:2023-11-28 04:29:56 24 4
gpt4 key购买 nike

这是我的 .css 文件...不明白为什么我不能滚动

#root {
overflow-y: scroll;
height: 100%;
}
.titles {
font-family: times, Times New Roman, times-roman, georgia, serif;
font-size: 48px;
line-height: 40px;
letter-spacing: -1px;
color: #444;
margin: 0 0 0 0;
padding: 0 0 0 0;
font-weight: 100;
}
.title-subtitle{
font-family: times, Times New Roman, times-roman, georgia, serif;
font-size: 28px;
line-height: 40px;
letter-spacing: -1px;color: #444;
margin-top:0px;

}

然后在我的 html 文件中我有这个:

<!DOCTYPE html>
<html lang="en">
<link rel="stylesheet" type="text/css" href="../src/style.css">
<head>

<meta charset="utf-8">
<title>React App</title>
</head>
<body>
<div id="root"></div>
</body>
</html>

但每次我垂直渲染或缩小页面大小时,我都无法获得滚动条....

最佳答案

为了在 #root 上设置 100%,您还必须将 htmlbody 设置为 100%:

html, body {
height: 100%;
}

关于html - 我在滚动时遇到困难,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41786389/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com