mouscind

用CSS+DIV来控制滚动条

下面是代码,用DIV来做,易于实现

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 "> 

<html xmlns="http://www.w3.org/1999/xhtml"> 

<head> 

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 

<title>DIV 制作滚动条</title> 

<style> 

* {  

 margin:0;  

 padding:0;  

}  

body {  

 font-size:12px;  

 font-family:Verdana, Arial, Helvetica, sans-serif;  

 background:#FFFFFF;  

 margin:10px;  

}  

#box1 {  

 border:1px solid #cccccc; padding:2px; width:80%; height:100px;  

 margin:0 auto;  

}  

#box2 {  

 height:100%;overflow: auto;  

}  

</style> 

</head> 

<body> 

<div id="box1"> 

  <div id="box2">滚动条文字<br />     

  </div> 

</div> 

</body> 

</html> 

分类:

技术点:

相关文章:

  • 2021-10-15
  • 2022-01-18
  • 2022-01-30
  • 2021-06-17
  • 2022-03-08
  • 2021-06-28
  • 2021-07-09
  • 2021-12-29
猜你喜欢
  • 2021-08-29
  • 2021-12-17
  • 2021-12-04
  • 2022-12-23
  • 2021-10-13
  • 2021-11-01
  • 2021-05-19
相关资源
相似解决方案