CSS控制链接—CSS偽类
来源:互联网 发布:网络摄像头装什么卡 编辑:程序博客网 时间:2024/06/04 18:17
CSS控制元素的某种状态---偽类(用于向某些选择器添加特殊的效果)
偽类的语法:元素标签 偽类名称{属性:属性值;}
a:link:未访问的链接
a:hover:鼠标移动到链接上
a:active:鼠标按下链接
a:visited:已访问的链接
如果在点击过后再返回到该页面还有一些效果的话 就按照该顺序给链接添加状态 L V H A
自定义链接的CSS类:
a.类名称:状态(即选择符.类名称:偽类名称{属性:属性值})
<!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控制链接—CSS偽类</title><style type="text/css"> a:link{text-decoration:none; color:#000;} a:visited{text-decoration:none; color:#6F0;} a:hover{text-decoration:underline; color:#00F;} a:active{text-decoration:overline; color:#F00;} a.web:visited{text-decoration:none; color:#000;}</style></head><body> <div id="link"> <a href="http://www.baidu.com" class="web">网页设计</a> | <a href="http://www.baidu.com">平面设计</a> | <a href="http://www.baidu.com">网站前端</a> | <a href="http://www.baidu.com">动画设计</a> | <a href="http://www.baidu.com">软件开发</a> | <a href="http://www.baidu.com">网页营销</a> <a href="http://www.baidu.com">我会闪</a> </div> </body></html>
:focus{属性:属性值}设置对象在成为输入焦点时的样式(IE6/7不支持)
<!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控制链接—CSS偽类</title><style type="text/css"> input{ width:200px; height:25px; border:2px solid #FF0; } input:focus{ background:#9FF; }</style></head><body> <label>用户名: <input type="text" name="username"/></label> <label>密 码: <input type="text" name="pwd"/></label></body></html>
0 0
- CSS控制链接—CSS偽类
- CSS 控制链接变换
- CSS控制链接
- css链接控制div显示
- CSS——链接
- 关于css控制页面链接的方法
- css控制链接不同的样式
- CSS链接
- CSS链接
- CSS 链接
- CSS链接
- Css链接
- css 链接
- CSS 链接
- CSS 链接
- CSS基础知识二(段落设置CSS效果、图片边框、div和span区别、CSS控制背景、CSS控制链接)
- html+css----css控制
- 控制css
- HIVE简介
- 文本分类
- 使用mfc打开文件对话框
- ios 正则表达式
- VisionMobile:2014年Q1移动开发者经济报告(七)3.1、优选平台
- CSS控制链接—CSS偽类
- 常用嵌入式相关的网站及论坛
- Hello,高清屏
- android adb shell
- Thinking at Java 8 Interface Default Methods
- C中嵌入python问题解答
- 各个errno对应的意义
- 运用此语句可以解决80端口占用的问题
- usb转串口的串口名自动查找和匹配