我正在使用CSS编码。以下是我当前的滚动框代码,但我很好奇是否有办法使一个额外的滚动框小于此滚动框。
.scrollbox {
height: 370px;
width: 415px;
overflow: auto;
padding: 20px;
font-family: Arial, Helvetica, sans-serif;
font-size: medium;
color: #fff;
background: transparent;
}
答案 0 :(得分:0)
这取决于您的文字,请检查此jsfiddle希望对您有帮助
.scrollbox {
width: 210px;
height: 210px;
overflow: auto;
color:red;
text-align:left;
margin:0 auto;
}
<div class="scrollbox">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nmmy nibh euismod tincidunt ut laoreet dolore magna aliquam erat voluonutpat.Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nmmy nibh euismod tincidunt ut laoreet dolore magna aliquam erat voluonutpat.Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nmmy nibh euismod tincidunt ut laoreet dolore magna aliquam erat voluonutpat.
</div>