gpt4 book ai didi

html - Bootstrap 3 并排两个 50% 宽度的 div

转载 作者:太空宇宙 更新时间:2023-11-04 02:33:49 25 4
gpt4 key购买 nike

过去两天我一直在努力完成这个任务。请有人帮忙。我想把页面分成两半。左侧 100% 高度,右侧只是滚动显示更多内容。为什么右侧塌陷在左侧之上?如何解决 Bootstrap 3 中的这个谜题?这是我的代码:

<section id="main-body" class="container-fixed main-body">
<div class="row text-center">
<div class="col-md-6 left-side-home-outer">
Left Side Content
</div>

<div class="col-md-6 right-side-home">
Right Side Content
</div>
</div>
</section>

.left-side-home-outer {
border: 1px solid blue;
height: 100%;
position: fixed;
font-family: "Roboto";
font-weight: 800;
}

.right-side-home-outer {

border: 1px solid blue;
height: 100%;
width: 50%;
overflow: auto;
font-family: "Roboto";
font-weight: 800;
}

如果可能的话,如果我想添加一个固定在左侧底部的页脚,CSS 应该是什么?多谢。

最佳答案

不需要 position: fixed.. 这就是导致内容重叠的原因。

此外 width:50% 也是多余的..因为它已经是一个 col-md-6..一个 50% 宽度的列。

<section id="main-body" class="container-fixed main-body">
<div class="row text-center">
<div class="col-md-6 left-side-home-outer">
Left Side Content
</div>

<div class="col-md-6 right-side-home">
Right Side Content
</div>
</div>
</section>

.left-side-home-outer {
border: 1px solid blue;
height: 100%;
font-family: "Roboto";
font-weight: 800;
}

.right-side-home-outer {

border: 1px solid blue;
height: 100%;
overflow: auto;
font-family: "Roboto";
font-weight: 800;
}

关于html - Bootstrap 3 并排两个 50% 宽度的 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36070657/

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