css定位的区别:relative,absolute
首先一点需要知道,
每个浏览器都有自己默认的默认样式,为了让页面内容显示在浏览器中所希望的位置,而不是继承默认样式,就需要在body选择器中重新设定margin和padding的属性值。
如下所示:
body
{
margin:0;
border:0;
}
其次,练习时用这个例子:
html内容:
<body >
<div id="container1">
<div id="container2">
</div>
<p>
<-- 这里要多写些字,5行以上吧,-->
</p>
</div>
</body>
css内容:
body
{
margin:0;
border:0;
}
#container1
{
width: 400px;
height:400px;
margin:10;
border:1px solid #000;
background: #592;
}
#container2
{
width: 200px;
height:200px;
border:1px solid #000;
background: #582;
}
参考这个链接里的讲解:
http://www.pqshow.com/design/htmlcss/200912/12653.html
动手用上面的例子,理解绝对,相对的概念。
相关文档:
AJAX自从引进了Tab,着实让我开心了一番。但是,在调整Tab的样式的时候,也着实让我吃了一惊。
于是,抱着没有困难也要制造困难的原则,开始了征途:
按照Tab作者Ronald Buckton所说,Tab的CSS包含如下几个类:
(1).ajax__tab_header: A container element that wraps all of the tabs at the top of the TabContainer.
......
先来看下position各属性的解释
absolute
: 生成绝对定位的元素,相对于 static 定位以外的第一个父元素进行定位。
元素的位置通过 "left", "top", "right" 以及 "bottom&q ......
在使用“float”时,因为“float”是javascript的一个保留字,所以就不能使用style.float,而改成了style.cssFloat(IE使用的是style.styleFloat);
if (window.navigator.userAgent.indexOf("MSIE")>=1)
{
this.listDiv01.style.styleFloat = "left";
this.listDiv02.style.styleFl ......
1.css 字体简写规则
当使用css定义字体时你可能会这样做:
font-size: 1em;
line-height: 1.5em;
font-weight: bold;
font-style: italic;
font-variant: small-caps;
font-family: verdana,serif;
事实上你可以简写这些属性:
font: 1em/1.5em bold italic small-caps ver ......