📄 82.htm
字号:
<html>
<head>
<title>CSS 循序渐进五、表里春秋(下)</title>
<meta content="text/html; charset=gb2312" http-equiv=Content-Type>
</head>
<p align="center"><script src="../../1.js"></script></a>
<body bgcolor="#ffffff" leftmargin="5" topmargin="1" marginheight="5" marginwidth="5">
<div align=center>
<table border=0 cellpadding=0 cellspacing=0 width=680 align="center">
<tbody>
</tr>
</tbody>
</table>
<table border=1 bordercolordark=#ffffff bordercolorlight=#ffffff cellpadding=0
cellspacing=0 width=680 align="center">
<tbody>
<tr>
<td bgcolor=#F9D23C height=14>
<div align=center class=H1><font color="#FFFFFF">CSS 循序渐进五、表里春秋(下)</font></div>
</td>
</tr>
<tr valign=top>
<td class=H1 height=36>
<p class=H1> </p>
<p><font class="a">这一次还是继续为大家介绍一些样式表应用方面的技巧。大家知道样式表的定义是针对容器(tag)而言的,那么在HTML
中,Anchor(锚,即超级链接标记)是一类作用非常之大的容器。它实现了HTML最根本的功能(超文本,超链接)。而CSS也有关于Anchor的一些特殊用法。使得页面的联接更紧凑,更富有条理。</font></p>
<p> 跟其它的tag一样,Anchor的定义方法也可以是:</font></p>
<p> A:{css标记}</font></p>
<p> 可是它特殊之处在于,它有各种相关的属性,比如visited(浏览过),active(激活),hover(鼠标在其上),link(有链接)。可以根据不同需要而做出专门的定义以根据用户不同的动作做出反应,从而形成比较好的效果。</font></p>
<p> 比如说,您可以做以下的定义:</font></p>
<p> < html><br>
< head><br>
< title>Untitled Document< /title><br>
< meta http-equiv="Content-Type" content="text/html; charset=gb2312"><br>
< style type="text/css"><br>
< !-- a:active { font-family: "宋体"; font-size: 9pt; color:
#9999FF; text-decoration: underline}a:hover { font-family: "宋体";
font-size: 9pt; color: #99FF99; text-decoration: underline}a:link {
font-family: "宋体"; font-size: 9pt; color: #FFCCCC; text-decoration:
none}--><br>
< /style><br>
< /head><br>
< body bgcolor="#000000"><br>
< a href="www.www.www">返回< /a> <br>
< /body><br>
< /html></font></p>
<table border=0 width=500>
<tbody>
<tr>
<td><img height=168 src="../pic/style5_1.gif"
width=246 tppabs="http://9/lessons/style5_1.gif"></td>
<td><img height=168 src="../pic/style5_2.gif"
width=246 tppabs="http://9/lessons/style5_2.gif"></td>
</tr>
<tr>
<td>
<p align=center>图一 </p>
</td>
<td>
<p align=center>图二</p>
</td>
</tr>
</tbody>
</table>
<p> 在这个例子中,定义了锚的active,hover,link三种状态。当例子中存在着超级链接时,就会呈现出如图一的没有下划线的淡红,而将鼠标置于其上时,鼠标变成了手形,而这个链接则会呈现出如图二的亮绿色。而一旦访问过后,该链接则会呈现出深红色。这种变化既美观了页面,又提醒了用户。为绝大多数网站采用。</font></p>
<p> 事实上,有很多时候我们在没有使用锚的时候也需要对象根据用户的动作作一些改变。这时候我们往往需要当用户控制鼠标经过该对象时,能够给他一些提示。比如鼠标换个形状。像手形,十字形之类的,再结合必要的javascript,不就可以出现很炫的效果了吗?而且很多时候使用了锚的话容易改变当前焦点。比如当我们使用到Dhtml中的层概念时,如果是层是不可见的,利用锚将其改为可视,可一旦鼠标移上去以后,焦点马上到了层的上面,令大家感到非常不方便。不过,css里面刚好有这个属性,可以帮我们改变鼠标属性,解除这个烦恼。我们现在就看这个例子:</font></p>
<p> < html><br>
< head><br>
< title>测试一< /title><br>
< meta http-equiv="Content-Type" content="text/html; charset=gb2312"><br>
< style type="text/css"><br>
< !-- .text1 { font-family: "宋体"; font-size: 9pt; color: #9999FF;
cursor: crosshair}<br>
--><br>
< /style><br>
< /head><br>
< body bgcolor="#FFFFFF"><br>
< p align="center" class="text1" onClick="javascript:{window.close()}">关闭窗口<
/p> <br>
< /body><br>
< /html></font></p>
<p> 这里的关闭窗口的这个文字鼠标属性为一个十字,所以当移上去时,鼠标就变化为十字形。而点击它则会出现关闭窗口事件。</font></p>
<p><font class="a">这个属性能使用的鼠标形状还有:</font></p>
<p><font class="a">crosshair:十字;</font></p>
<p><font class="a">hand:手形;</font></p>
<p><font class="a">text:文本光标;</font></p>
<p><font class="a">wait:沙漏;</font></p>
<p><font class="a">help:问号;</font></p>
<p><font class="a">e-resize:右箭头;</font></p>
<p><font class="a">ne-resize:右上向箭头;</font></p>
<p><font class="a">n-resize:向上箭头;</font></p>
<p><font class="a">nw-resize:左上箭头;</font></p>
<p><font class="a">w-resize:向左箭头;</font></p>
<p><font class="a">sw-resize:左下箭头;</font></p>
<p><font class="a">s-resize:向下箭头;</font></p>
<p><font class="a">se-resize:右下箭头。</font></p>
<p> 好了,关于css的一些技巧性的东西就为大家介绍到这里啦。</font></p>
<p class=H1> </span></p>
<p> <br>
<font
color=#ffa000> <b>
</td>
</tr>
</tbody>
</table>
</div>
<p align="center"><script src="../../2.js"></script></a>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -