这是HTML,网页Div正在运作!我需要在第二个div上添加更多内容,并在我这样做时启用滚动。
<section class="vertical-scrolling" id="section">
<div id="abt">
<div id="about" >
<h3>about</h3>
</div>
<div id="abouttxt">
content with scrolling
</div>
</div>
</section>
这是CSS:
#about {
height: relative;
float: left;
}
#abouttxt {
float: right;
width: 50%;
text-align: left;
text-align: justify;
text-justify: inter-word;
}
答案 0 :(得分:0)
HTML:
<div id="content">
<div id="left"></div>
<div id="right"></div>
</div>
CSS:
#content, html, body {
height: 98%;
}
#left {
float: left;
width: 50%;
background: red;
height: 100%;
overflow: scroll;
}
#right {
float: left;
width: 50%;
background: blue;
height: 100%;
overflow: scroll;
}
答案 1 :(得分:0)
HTML:
<div class="section">
<div class="leftSide">
<div class="box">Whatever</div>
</div>
<div class="rightSide">
<div class="box">Whatever</div>
<div class="box">Whatever</div>
<div class="box">Whatever</div>
</div>
</div>
CSS:
.leftSide{
float: left;
width: 50%;
background: blue;
height: 100%;
}
.rightSide{
float: left;
width: 50%;
background: red;
height: 100%;
overflow: scroll;
}
然后你必须使用fullpage.js的选项normalScrollElements
:
$('#fullpage').fullpage({
sectionsColor: ['yellow', 'orange', '#C0C0C0', '#ADD8E6'],
normalScrollElements: '.rightSide'
});