gpt4 book ai didi

html - 如何在网页中创建两个独立的栏目?

转载 作者:搜寻专家 更新时间:2023-10-31 22:04:20 25 4
gpt4 key购买 nike

我想在网页中有两列,每一列都有自己的滚动条,而不是两者都使用的通用滚动条。例如,我的想法是沿着新的 twitter ui.. 如果列表长于高度,则一列显示带有滚动条的列表,类似地,另一列显示带有自己滚动条的详细信息。

我只是迷失了前进的方向,我是否需要使用框架来实现这一目标。是否可以抑制全局滚动条,每列使用自己的带有 css 的滚动条?

最佳答案

HTML:

<html>
<body>
<div class='right'>
<!-- data -->
</div>
<div class='left'>
<!-- data -->
</div>
</body>
</html>

CSS:

body{
overflow:hidden; /* This will remove the default scroll, not really needed, safer nonetheless */
}
.right, .left{
overflow:auto; /* This will add a scroll when required */
width:50%;
float:left;
height: 100%
}

关于html - 如何在网页中创建两个独立的栏目?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4614306/

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