伪对象选择器&&属性选择器
来源:互联网 发布:html引入jquery.js 编辑:程序博客网 时间:2024/06/05 07:22
伪对象选择器
属性选择器:
属性选择器eg:
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>属性选择器</title> <style> p[class]{text-align: center} p[class="red"]{color:red} p[class="green"]{color:green;font-size: 16px} p[id*="n"]{color:blue} /*选择具有id属性且属性值为包含n的字符串的E元素*/ p[class$="w"]{color:blue} /*选择具有class属性且属性值以w结尾的E元素*/ p[class^="b"]{color:blue} /*选择具有class属性且属性值以r开头的E元素*/ p[class~="w"]{color:blue} /*选择具有class属性且属性值为一用空格分隔的字词列表,其中一个等于的w元素*/ p[id|="n"]{color:blue} /*选择具有class属性且属性值以r开头的E元素,并用连接符"-"分隔的字符串的E元素*/ </style></head><body><p class="red">haohfoahfohsfgfswg</p><p class="yellow">haohfoahfohsfgfswg</p><p class="green">haohfoahfohsfgfswgd</p><p id="blue">haohfoahfohsfgfswgd</p><p id="black">haohfoahfohsfgfswgd</p><p class="black">haohfoahfohsfgfswgd</p><p class="pure">haohfoahfohsfgfswgd</p><p class="grey">haohfoahfohsfgfswgd</p></body></html>
伪对象选择器&&属性选择器综合运用:
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>伪对象选择器&&属性选择器</title> <style> a{ text-decoration: none; color:blue; } a[id]::before{content:url(img/word.jpg)} a[class*="c"]::before{content:url(img/txt.jpg)} a[class$="e"]::before{content:url(img/ppt.jpg)} a[class|="aa"]::before{content:url(img/ppt.jpg)} a[class~="book"]::before{content:url(img/word.jpg)} a[class~="excel"]::before{content:url(img/excel.jpg)} </style></head><body><p><a href="" id="aa.word">演讲稿写作格式及范例</a></p><p><a href="" class="aa.doc">演讲稿的基本写作方法</a></p><p><a href="" class="aa.write">演讲稿的写作课件</a></p><p><a href="" class="aa-system">演讲稿的系统分析</a></p><p><a href="" class="fl book">秘书公文写作知识</a></p><p><a href="" class="fl excel">表格表格表格制作</a></p></body></html>
阅读全文
0 0
- 伪对象选择器&&属性选择器
- CSS3:伪对象选择器
- CSS选择器:属性选择器+后代选择器+子元素选择器+相邻兄弟选择器+伪类+伪元素
- CSS3的伪对象选择器
- 选择器 表单对象属性
- 表单对象属性选择器
- CSS3选择器(基础选择器、属性选择器、伪类选择器、选择器策略)
- 过滤选择器-表单对象属性过滤选择器
- jQuery选择器-表单对象属性选择器示例
- 伪选择器
- jQuery选择器 过滤选择器(六.表单对象属性过滤选择器)
- CSS3第一日--属性选择器与伪类选择器
- CSS学习(二)-结构伪类选择器、属性选择器
- CSS3之选择器1(属性选择器,结构伪类)
- CSS伪类选择器之属性选择
- 通过伪类选择器调整链接属性
- 表单对象属性过滤选择器
- 表单对象属性过滤选择器
- 一起学Python:TCP简介
- jqgrid 学习资料
- 第二天的学习
- 学习java注解,初试启动springboot项目
- 也来测测javascript拼接字符串不同方法的效率
- 伪对象选择器&&属性选择器
- 循环链表应用之约瑟夫环
- 一起学Python:tcp服务器
- Ubuntu 中英文man手册安装方法
- RadioButton某个图标突出效果
- 27.Nginx HTTP之监听套接字连接处理函数ngx_http_init_connection
- 1648
- java 输出输入流
- SharePoint Framework 基于团队的开发(三)