CSS笔记
一、星号*
应该是个通配符。比如
<style type="text/css">
.roundBorder *
{
background: white;
display: block;
height: 1px;
overflow: hidden;
}
</style>
……
<b class="roundBorder">
<b class="roundBorderLayer3"></b>
<b class="roundBorderLayer2"></b>
<b class="roundBorderLayer1"></b>
</b>
那么这个roundBorderLayer1、2、3都会受这个.roundBorder *的定义影响。
二、继承
CSS可以有多重继承。如
<div id="divTenet">
<div style="font-size:16px;width:240px;">鸟0</div>
<div><img src="img/k.gif" width="24" height="20" hspace="3" alt="鸟1"/>鸟1</div>
<div><img src="img/jc.gif" width="21" height="23" hspace="3" alt="鸟2"/>鸟2</div>
<div><img src="img/fx.gif" width="22" height="20" hspace="3" alt="鸟3"/>鸟3</div>
</div>
CSS里可以这样定义里面的<IMG>:#divTenet div img{vertical-align:middle;}
相关文档:
從上到下
body{
FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#ffffff,endColorStr=#000000);
} 二、从左上至右下渐变
body{
FILTER: Alpha( style=1,opacity=25,finishOpacity=100,
startX=50,finishX= 100,startY=50,finishY=100);
background-color: skyblue; ......
网页中我们经遇到刷新要保留表单里内容的时候,习惯的做法使用cookie,但是那样做实在是很麻烦,css中的behavior就为我们很好的解决了这个问题。
比如:
<input style="behavior:url(#default#savehistory)" name="youname" type="text" id="yourname" size="10" autocomplete="off">
......
自动换行问题,正常字符的换行是比较合理的,而连续的数字和英文字符常常将容器撑大,挺让人头疼,下面介绍的是CSS如何实现换行的方法
对于div,p等块级元素
正常文字的换行(亚洲文字和非亚洲文字)元素拥有默认的white-space:normal,当定义的宽度之后自动换行
html
css
1.(IE浏览器)连续的英文字符和阿拉伯数字,使用word ......
<!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/html; charset ......
hand是手型
pointer也是手型,这里推荐使用这种,因为这可以在多种浏览器下使用。
crosshair是十字型
text是移动到文本上的那种效果
wait是等待的那种效果
default是默认效果
help是问号
e-resize是向右的箭头
ne-resize是向右上的箭头
n-resize是向上的箭头
nw-resize是向左上的箭头
w-resize是向左的箭头
sw- ......