当前位置:网站首页>5. Attribute selector
5. Attribute selector
2022-06-13 08:41:00 【zhengqiqiqinqin】
The following common HTML Code
<p title="abc"> This is the first one p</p>
<p title="abcd"> This is the second p</p>
<p title="hello"> This is the third p</p>
<p> This is the fourth p</p>
<div title="abc"> This is a div Contents of Li </div>One 、 Attribute selector Syntax 1:[ Property name ] Select the element with the specified attribute .
CSS Code :
/*
[ Property name ] Select the element with the specified attribute .
*/
[title]{
color: red;
}Running results :

Two 、 Attribute selector Syntax 2:[ Property name = Property value ] Select the element that contains the specified attribute and attribute value
CSS Code :
/*
[ Property name = Property value ] Select the element that contains the specified attribute and attribute value
*/
[title=abc]{
color: red;
} Running results :

3、 ... and 、 Attribute selector Syntax 3:[ Property name ^= Property value ] Select the element whose attribute value begins with the specified value
CSS Code :
/*
3 [ Property name ^= Property value ] Select the element whose attribute value begins with the specified value
*/
[title^=abc]{
color: red;
}Running results :

Four 、 Attribute selector Syntax 4:[ Property name $= Property value A] Select attribute value to attribute value A Ending element
CSS Code :
/*
4 [ Property name $= Property value ] Select the element whose attribute value ends with the specified value
*/
[title$=c]{
color: red;
}Running results :

5、 ... and 、 Attribute selector Syntax 5:[ Property name *= Property value A] Select include attribute value as attribute value A All attribute elements of
CSS Code :
/*
5 [ Property name *= Property value ] Select all elements with a certain value in the attribute value
*/
[title*=e]{
color: red;
}Running results :

边栏推荐
- MySQL query exercise
- 2021-04-16
- In order to resist the flood, the soldiers have been fighting for 89 hours. How many days and hours are there in total?
- Namespace in TS (1)
- 5、 Constant, variable
- Remote access and control
- 8、 JS data type conversion
- SQL injection question type (manual injection +sqlmap)
- DIY无人机(匿名拓控者P2+F330机架)
- Journal d'acquisition du faisceau de fichiers à Elk
猜你喜欢

Use of addeventlistener in JS

Methods of importing and exporting settings in Altium Designer

0. some doubts about learning SolidWorks for the first time

On the use of regular expressions (bracket problem)

Buuctf web (VI)

0.一些自己初學Solidworks的疑惑

VS安装VAssistX插件导致WPF-XAML文件输入中文出现乱码问题解决方案

0.一些自己初学Solidworks的疑惑

1.SolidWorks各模块的学习顺序

JS - set countdown for Date object case
随机推荐
Notes on development experience: TP5 exp query, SQL analysis, JQ, applet, right-click menu, Linux skills, shell skills, mysql, etc
Remote access and control
0. some doubts about learning SolidWorks for the first time
About redis encapsulation tool class using distributed locks
PHP isset() method ignores data error handling caused by null parameter value
Data accuracy problems caused by inconsistent data types during sum in MySQL
JS - simple ATM of the for cycle case
Phpexcel 10008 error resolution
關於RSA加密解密原理
Format_ String_ Server
0.一些自己初學Solidworks的疑惑
Use of addeventlistener in JS
浅析Visual Studio 使用
Mobile terminal development I: basic concepts
SQL injection question type (manual injection +sqlmap)
MySQL parsing serialized fields
How to modify desktop path in win10 system
Buuctf web (V)
淘宝商品历史价格接口/商品历史价走势接口代码对接分享
6、 JS naming rules and specifications