DIV+CSS制作滚动条
<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>
<div id="box1">
<div id="box2">滚动条出来拉<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
</div>
</div>
相关文档:
当div层为float时,IE6中box左右的margin会加倍
比如:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/htm ......
<div style="padding-top:5px;width:200px;height:15px;background-color:#ffeeee"> test </div>
以上代码在IE中和firefox会有不同的效果.最主要原因是firefox解释padding-top与IE的效果不同
fixfox对DIV总高度是padding-top+height的,而IE中,padding-top是包含在height中的,
要解决这一个矛盾,可以利用!imp ......
一些新手朋友对选择器一知半解,不知道在什么情况下运用什么样的选择器,这是一个比较头疼的问题,针对新手朋友,对CSS选择器作一些简单的说明,希望能对大家的学习工作有一定的帮助,更多的CSS知识请参考Webjx.com的其他文章。
准确而简洁的运用CSS选择器会达到非常好的效果。我们不必通篇给每一个元素定义类(class)或 ......
1. 将网页或元素居中
HTML:
<div class="wrap">
</div><!-- end wrap -->
CSS:
.wrap { width:960px; margin:0 auto;}
......