如何解决使用主滚动条使滚动框向下滚动
我想使滚动框向下滚动,而不必在框上激活光标。当框完全可见时,我希望它与主滚动条一起滚动。这可能需要javascript(随意使用)。 我的盒子是:
.myImg{
text-align: center;
position: relative;
}
.box1 {
background-color: #fff;
width: 60%;
height: 51%;
border: none;
font-size: 10vw;
position: absolute;
text-align: center;
top: 13%;
left: 20%;
justify-content: center;
overflow-y: scroll; /* Add the ability to scroll */
}
/* Hide scrollbar for Chrome,Safari and Opera */
.box1::-webkit-scrollbar {
display: none;
}
/* Hide scrollbar for IE,Edge and Firefox */
.box1 {
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}
<body>
<div class="myImg">
<img src="http://test.dogily.us.to/images/écran.png" alt="Computer screen" style="width:100%;">
<div class="box1">This is my text. Some text and other text. It is a paragraph with words,words and other words.</div>
</div>
</body>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。