css 内容溢出显示垂直滚动条,内容不超出就不显示滚动条

时间:2019-10-22 18:23:23   收藏:0   阅读:315

搬运自:https://www.cnblogs.com/wangyuanyuanlovexuanxuan/p/7767767.html

 

html:

<style>
  .div1{
    width:200px;
    height:100px;
    overflow-y:auto;//关键
  }
</style>

<div class="div1">   内容 内容 内容 内容 内容 内容 内容 </div>

 

原文:https://www.cnblogs.com/linjiangxian/p/11721510.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!