用CSS+DIV來控制捲軸

來源:互聯網
上載者:User

下面是代碼,用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> 

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.