背景颜色
body {background-color:#b0c4de;}
h1 {background-color:#6495ed;}
p {background-color:#e0ffff;}
div {background-color:#b0c4de;}
背景图像
body {background-image:url('paper.gif');}
body{background-image:url('gradient2.png');background-repeat:repeat-x;}水平方向平铺 (repeat-x)
body{background-image:url('img_tree.png');background-repeat:no-repeat;}不让图像平铺background-repeat
属性:
body{background-image:url('img_tree.png');background-repeat:no-repeat;background-position:right top;}改变图像在背景中的位置:background-position
属性
body{background-image:url('img_tree.png'); background-repeat:no-repeat; background-position:50% 50%;}百分数值将图像在其元素中居中
CSS 链接样式
a:link
- 正常,未访问过的链接a:visited
- 用户已访问过的链接a:hover
- 当用户鼠标放在链接上时a:active
- 链接被点击的那一刻
当设置为若干链路状态的样式,也有一些顺序规则:
a:hover
必须跟在a:link
和a:visited
后面a:active
必须跟在a:hover
后面
a:link {color:#FF0000;} /* 未访问链接*/
a:visited {color:#00FF00;} /* visited link */
a:hover {color:#FF00FF;} /* mouse over link */
a:active {color:#0000FF;} /* selected link */
背景颜色
背景颜色属性指定链接背景色:
a:link {background-color:#B2FF99;}
a:visited {background-color:#FFFF85;}
a:hover {background-color:#FF704D;}
a:active {background-color:#FF704D;}
鼠标形状
常用鼠标形状如下所示:
属性值 | 描述 |
---|---|
default | 默认光标,箭头 |
pointer | 超链接的指针,手型 |
wait | 指示程序正在忙 |
help | 指示可用的帮忙 |
text | 指示文本 |
crosshair | 鼠标呈现十字状 |