​css3属性选择器总结

css3属性选择器总结

1E[attr]只使用属性名,但没有确定任何属性值

<p miaov="a1">111111</p>

<p miaov="a2">111111</p>

p[miaov]{background: red;}  

WGK2N}J{94%J[$$}0AJ~N[O.png

 /*所有属性为miaov的元素都会被背景变红,不会看你的值只会看你的属性名字*/

 

 

 

2E[attr="value"]指定属性名,并指定了该属性的属性值

<span miaov="aa">111</span><br/>

<span miaov="bb">111</span><br/>

<span miaov="cc">111</span><br/>

span[miaov='aa']{background: yellow;}

DE60ZE64`X]19V4[J[J5ILK.png

只有指定的属性和属性值才会变颜色

 

 

 

3E[attr~="value"]指定属性名,并且具有属性值,此属性值是一个词列表,并且以空格隔开,其中词列表中包含了一个value词,而且等号前面的“”不能不

<miaov="a1 a2 a3">111111</p>

<miaov="a1">111111</p>

<miaov="a3 a1">111111</p>

<miaov="a4">111111</p>

p[miaov~='a1']{background: yellow;}

EPHI%Y)0(8G$UN(3WSE1W_C.png

 

 

 

 

 

 

4E[attr^="value"]指定了属性名,并且有属性值,属性值是以value开头的

<miaov="a1 a2 a3">p1</p>

<miaov="a1">p2</p>

<miaov="a3 a1">p3</p>

<miaov="a4">p4</p>

p[miaov^='a1']{background: yellow;}

YU3FFT])R@VSV2Z9_`@O30J.png

 

 

 

 

5E[attr$="value"]指定了属性名,并且有属性值,而且属性值是以value结束的

<miaov="a1 a2 a3">p1</p>

<miaov="a1">p2</p>

<miaov="a3 a1">p3</p>

<miaov="a4 a3">p4</p>

p[miaov$='a3']{background: yellow;}

C8%S1{R~7PBLH$4%BB(5B5I.png

 

 

 

6E[attr*="value"]指定了属性名,并且有属性值,而且属值中包含了value

<miaov="a1 a2 a3">p1</p>

<miaov="a1">p2</p>

<miaov="a3 a1">p3</p>

<miaov="a4 a3">p4</p>

p[miaov*='a1']{background: yellow;}

{`S)(F[}4`RUV_`8]Z_7@HK.png

 

 

 

 

 

7E[attr|="value"]指定了属性名,并且属性值是value或者以“value-”开头的值(比如说zh-cn

<miaov="a1 a2 a3">p1</p>

<miaov="a1">p2</p>

<miaov="a3 a1">p3</p>

<miaov="a1-a3">p4</p>

p[miaov|='a1']{background: yellow;}

AB@%5%{SH72O4KE4VGIMWXX.png


 

本文转自

新网学会 51CTO博客,原文链接:http://blog.51cto.com/xwxhvip/2057985 ,如需转载请自行联系原作者

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/279180.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

程序代码初学者_初学者:如何使用热键在Windows中启动任何程序

程序代码初学者Assigning shortcut keys to launch programs in Windows is probably one of the oldest geek tricks in the book, but in true geek fashion we are going to show you how to do it in Windows 8. 分配快捷键以在Windows中启动程序可能是本书中最古老的怪胎技…

stevedore——启用方式

2019独角兽企业重金招聘Python工程师标准>>> setuptools维护的入口点注册表列出了可用的插件&#xff0c;但是并没有为最终用户提供使用或启用的方法。 下面将描述用于管理要使用的扩展集的公共模式。 通过安装方式启用 对于许多应用程序&#xff0c;仅仅安装一个扩…

C# -- 文件的压缩与解压(GZipStream)

文件的压缩与解压 需引入 System.IO.Compression; 1.C#代码&#xff08;入门案例&#xff09; 1 Console.WriteLine("压缩文件...............");2 using (FileStream fr File.OpenRead("d:\\test.txt"))3 {4 …

win7屏保文件.scr_如何将屏保添加到Ubuntu 12.04

win7屏保文件.scrUbuntu 12.04 doesn’t ship with any screen savers, just a black screen that appears when your system is idle. If you’d rather have screensavers, you can swap gnome-screensaver for XScreenSaver. Ubuntu 12.04没有附带任何屏幕保护程序&#xff…

简单读写XML文件

IPAddress.xml 文件如下&#xff1a; <?xml version"1.0" encoding"utf-8"?><IP><IPAddress>192.168.0.120</IPAddress></IP> 在 Form 窗体(读取XML配置.Designer.cs)中有如下控件&#xff1a; 代码 privateSystem.Wind…

如何与Ubuntu One同步配置文件

Ubuntu One lets you easily synchronize files and folders, but it isn’t clear how to sync configuration files. Using Ubuntu One’s folder synchronization options or some symbolic links, you can synchronize configuration files across all your computers. Ubu…

智能家居设备_您的智能家居设备正在监视您吗?

智能家居设备In a world where we’re all paranoid about devices spying on us (and rightfully so), perhaps no other devices receive more scrutiny than smarthome products. But is that scrutiny warranted? 在一个我们都对监视设备的人都抱有偏执的世界(理应如此)&a…

Jenkins忘记admin密码处理方法

1、先找到enkins/config.xml文件&#xff0c;并备份。 此文件位于Jenkins系统设置的主目录&#xff0c;根据自己的配置情况而定。我的位置如下 /data/temp/jenkins/config.xml2、然后编辑config.xml删除<useSecurity>true</useSecurity>至</securityRealm>&a…

科研绘图工具软件_如何在Windows 10 Mail中使用绘图工具

科研绘图工具软件Microsoft recently released a new feature for the Windows 10 Mail app that lets you convey messages with drawings right inside the body of an email. This is a great way to quickly sketch things like graphs or tables to get your point across…

子元素相对于父元素垂直居中对齐

记个笔记 1. 元素相对于浏览器居中 <style>.window-center {/* 将position设置为fixed&#xff0c;使元素相对于浏览器窗口定位 */position: fixed;/* 将margin设置为auto&#xff0c;使浏览器自动推算元素外边距 */margin: auto;/* 将上下左右边距&#xff08;相对于浏览…

网站运行java_定制化Azure站点Java运行环境(5)

Java 8下PermGen及参数设置在上一章节中&#xff0c;我们定制化使用了Java 8环境&#xff0c;使用我们的测试页面打印出了JVM基本参数&#xff0c;但如果我们自己观察&#xff0c;会发现在MXBeans中&#xff0c;没有出现PermGen的使用数据&#xff0c;初始大小等信息&#xff0…

三阶魔方魔方公式_观看此魔方的自我解决

三阶魔方魔方公式Finally: a Rubik’s cube that can solve itself. A maker named Human Controller built it in Japan, and you can see it in action right now. 最后&#xff1a;一个可以解决自身问题的魔方。 一家名为Human Controller的制造商在日本制造了它&#xff0…

pc样式在ie8中的bug

2019独角兽企业重金招聘Python工程师标准>>> pc样式在ie8中的bug 1,box-sizing:border-box: 在ie中,此属性的使用有限制: (在IE8中&#xff0c;min-width属性适用于content-box即使box-sizing设置为border-box。 Chrome select在使用时从元素中选择选项时遇到问…

下载: 虾米音乐_您所说的内容:如何组织凌乱的音乐收藏

下载: 虾米音乐Earlier this week we asked you to share your tips, tricks, and tools, for managing a messy music collection. Now we’re back to share so great reader tips; read on to find ways to tame your mountain of music. 本周早些时候&#xff0c;我们要求您…

Django form表单

Django form表单 目录 普通方式手写注册功能 views.pylogin.html使用form组件实现注册功能 views.pylogin2.html常用字段与插件 initialerror_messagespasswordradioSelect单选Select多选Select单选checkbox多选checkboxDjango Form所有内置字段校验补充进阶 应用Bootstrap样式…

java 多线程 优先级_java多线程之线程的优先级

在操作系统中&#xff0c;线程可以划分优先级&#xff0c;优先级较高的线程得到CPU资源较多&#xff0c;也就是CPU优先执行优先级较高的线程对象中的任务(其实并不是这样)。在java中&#xff0c;线程的优先级用setPriority()方法就行&#xff0c;线程的优先级分为1-10这10个等级…

PyQt5应用与实践

2015-01-16 19:00 by 吴秦, 69476 阅读, 5 评论, 收藏, 编辑 一个典型的GUI应用程序可以抽象为&#xff1a;主界面&#xff08;菜单栏、工具栏、状态栏、内容区域&#xff09;&#xff0c;二级界面&#xff08;模态、非模态&#xff09;&#xff0c;信息提示&#xff08;Toolti…

plex实现流媒体服务器_Plex继续远离服务器,提供网络节目

plex实现流媒体服务器() Plex now offers a “Web Shows” feature in certain versions of their interface, providing access to shows from brands like TWiT, GQ, and Popular Science. Plex现在在其界面的某些版本中提供了“网络节目”功能&#xff0c;可以访问TWiT&…

MIME协议(三) -- MIME邮件的组织结构

一封MIME邮件可以由多个不同类型的MIME消息组合而成&#xff0c;一个MIME消息表示邮件中的一个基本MIME资源或若干基本MIME消息的组合体。每个MIME消息的数据格式与RFC822数据格式相似&#xff0c;也包括头和体两部分&#xff0c;分别称为MIME消息头和MIME消息体&#xff0c;它…

discord linux_最好的Discord机器人来启动服务器

discord linuxDiscord has an extensive API and good support for bots on their platform. Because of this, there are tons of bots to go around. However, many of them just copy one another’s functionality. We’ve picked out the ones that do it right, and comp…