设置DIV滚动条以及滚动条属性

当div所定义的区域的内容达到一定程度时,在div标签里面嵌入css样式表,定义overflow的属性值,设置滚动条相关的属性。

<style tyle="text/css">
.testDiv{
   border-style: solid ;     
   border-width: 50px ;    
   border-color: pink ;

   position: absolute ; /* 位置 绝对或者相对于最近的一个元素 relative absolute */
   top:200px ;
   left:300px ;
   height:200px ; /* 定义区域的高*/
   width:300px ;
  
   /*   滚动条 */
    /*   overFlow: auto ; */ /* visible :却省的 hidden auto scroll */
         overFlow-x: scroll ;
       overFlow-y: hidden ;     
  
    /*   滚动条相关的颜色属性 */
     scrollBar-face-color: green;        /* 滑块 */
     scrollBar-hightLight-color: red;    /* 高亮 */
     scrollBar-3dLight-color: orange;    /* 3维光线 */
     scrollBar-darkshadow-color:blue;    /* 暗影    */
     scrollBar-shadow-color:yellow;      /* 阴影   */
     scrollBar-arrow-color:purple;       /* 箭头 */
     scrollBar-track-color:black;         /* 滑道颜色 */
     scrollBar-base-color:pink;          /* 主要颜色 */
  
          
}

</style>

注:

1. overFlow:

visible    却省值,没有滚动条,根据内容自动扩撑区域的大小,即定义的区域无效
scroll     总是显示滚动条
hidden   没有滚动条,超出区域的内容不可见
auto       根据内容自动判断是否添加滚动条

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值