论坛交流
首页办公自动化| 网页制作| 平面设计| 动画制作| 数据库开发| 程序设计| 全部视频教程
应用视频: Windows | Word2007 | Excel2007 | PowerPoint2007 | Dreamweaver 8 | Fireworks 8 | Flash 8 | Photoshop cs | CorelDraw 12
编程视频: C语言视频教程 | HTML | Div+Css布局 | Javascript | Access数据库 | Asp | Sql Server数据库Asp.net  | Flash AS
当前位置 > 文字教程 > div+css布局教程
Tag:css,入门,技巧,div,实例,示例,菜单,布局,web2.0,ul,li,经验,列表,web标准,xhtml,web标准,浏览器,兼容,css hack,表格,视频教程

{CSS}css教程:CSS伪类

文章类别:div+css布局 | 发表日期:2008-9-26 11:33:09

CSS pseudo-classes are used to add special effects to some selectors.
CSS伪类可用来给一些选择器加上非凡效果。


Hyperlink
如何在文档内给超级连接加上不同的颜色

This example demonstrates how to add different colors to a hyperlink in a document.
Examples 实例:
div css xhtml xml Source Code to Run Source Code to Run [www.21shipin.com]

[ 可先修改部分代码 再运行查看效果 ]



Hyperlink 2
如何给超级连接加上其他样式

This example demonstrates how to add other styles to hyperlinks.
Examples 实例:
div css xhtml xml Source Code to Run Source Code to Run [www.21shipin.com]

[ 可先修改部分代码 再运行查看效果 ]


The syntax of pseudo-classes:
伪类语法:
div css xhtml xml Example Source Code Example Source Code [www.21shipin.com]
selector:pseudo-class {property: value}


CSS classes can also be used with pseudo-classes:
类也可以使用伪类:
div css xhtml xml Example Source Code Example Source Code [www.21shipin.com]
selector.class:pseudo-class {property: value}


锚点伪类 Anchor Pseudo-classes
A link that is active, visited, unvisited, or when you mouse over a link can all be displayed in different ways in a CSS-supporting browser:
当一个连接处于 活动,被访问,未访问或是当你鼠标移动到上面的时候都可以给它以不同的方式来表现,前提是浏览器支持CSS:
div css xhtml xml Example Source Code Example Source Code [www.21shipin.com]
a:link {color: #FF0000} /* unvisited link */
a:visited {color: #00FF00} /* visited link */
a:hover {color: #FF00FF} /* mouse over link */
a:active {color: #0000FF} /* selected link */


Note: a:hover MUST come after a:link and a:visited in the CSS definition in order to be effective!!
注重 a:hover 必须在a:link和 a:visited后出现,要有顺序才能正常显示效果!

Note: a:active MUST come after a:hover in the CSS definition in order to be effective!!
注重: CSS中a:active必须出现在a:hover定义后才能有效果!

Pseudo-classes and CSS Classes
伪类和CSS类


Pseudo-classes can be combined with CSS classes:
伪类可以与CSS类组合使用:
div css xhtml xml Example Source Code Example Source Code [www.21shipin.com]
a.red:visited {color: #FF0000}
<a class=\"red\" href=\"http://www.21shipin.com/\">CSS Syntax</a>

If the link in the example above has been visited, it will be displayed in red.
假如上面的连接已经被访问过了,它就会显示为红色。
视频教程列表
文章教程搜索
 
div+css推荐教程
div+css热门教程
看全部视频教程
购买方式/价格
购买视频教程: 咨询客服
tel:15972130058