CSS学习(六)——CSS 链接、光标、DHTML、缩放

来源:互联网 发布:数据安全责任承诺书 编辑:程序博客网 时间:2024/06/11 18:17

链接

伪类属性说明a:link表示该超链接文字尚未被点选a:visited表示该超链接文字已被点选过a:active表示该超链接文字正被点选,但未被放开a:hover表示当鼠标停留在文字上

例子:

<!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=utf-8" />  <title>CSS 链接、光标、DHTML、缩放</title>  <style type="text/css">    a:link{color:#009ad6;text-decoration:none;}    a:hover{color:#009ad6;text-decoration:underline;}    a:active{color:#009ad6;text-decoration:underline;}    a:visited{color:#009ad6;text-decoration:none;}  </style></head><body>  <a href="http://localhost:8081/">本机主页超链接</a></body></html>


光标

属性名称设定值说明cursorauto默认 crosshair光标是十字形 default光标是箭头 hand/pointer光标是手型或箭头 move光标是移动的符号 text光标是输入文字的符号 wait光标是漏斗 help帮助
光标图案还能设置为图片,具体代码可查询《CSS速查表》。


DHTML

属性名称:DHTML
设定值:url
说明:内联DHTML文件
例如:span{DHTML:url("font.htc");}

缩放

属性名称:zoom
设定值:百分数或者浮点实数
说明:可以将对象的尺寸放大或缩小
<!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=utf-8" />  <title>CSS 链接、光标、DHTML、缩放</title>  <style type="text/css">    img{width:200px;}    a:link{color:#009ad6;text-decoration:none;}    a:hover{color:#009ad6;text-decoration:underline;}    a:active{color:#009ad6;text-decoration:underline;}    a:visited{color:#009ad6;text-decoration:none;}    div{text-align:center;background:pink;height:400px;width:600px;zoom:0.5}  </style></head><body>  <div>    <a href="http://localhost:8081/">本机主页超链接</a><br />    <img src="image.jpg" />  </div></body></html>


0 0