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

链接

伪类属性 说明
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>


光标

属性名称 设定值 说明
cursor auto 默认
  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>


你可能感兴趣的:(html,css)