当前位置:网站首页>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_ Preliminary summary of database data (Continued)
- 關於RSA加密解密原理
- Namespace in TS (2)
- Tmall product details interface, tmall product coupon interface, tmall API interface, tmall price monitoring interface, tmall price comparison interface, brand rights protection interface, tmall sales
- HCIP_ MGRE comprehensive experiment
- 情绪处理技巧
- Input prohibit copy and paste
- MySQL installation and configuration under Windows
- centos 安装mysql及设置远程访问
- SQL injection question type (manual injection +sqlmap)
猜你喜欢
0. Quelques doutes au sujet de SolidWorks
Learning record 4:einops / / cudnn benchamark=true // hook
Using KVM to create three virtual machines that can communicate with local area network
CentOS installing MySQL and setting up remote access
HCIP_ MGRE experiment
Sky background map, navigation page lovefanfan top
d3.js&nvd3. JS - how to set the y-axis range - d3 js & nvd3. js — How to set y-axis range
Shellshock Attack Lab
JS - max. of array cases
useRoutes() may be used only in the context of a <Router> component.
随机推荐
\Difference between N and \r
Phpexcel 10008 error resolution
Use of addeventlistener in JS
JS - set countdown for Date object case
How app inventor accesses resource files in assets directory
Data accuracy problems caused by inconsistent data types during sum in MySQL
regular expression
DIY无人机(匿名拓控者P2+F330机架)
Invalid flex layout setting width
redis.exceptions.ConnectionError: Error 111 connecting to 172.16.8.128:6379. Connection refused.
JS array using the reduce() method
Mobile terminal development I: basic concepts
Tiktok keyword search list interface, ultra detailed interface docking steps
Disk management and disk partition operation
Custom exception class myexception
About redis encapsulation tool class using distributed locks
JS gets the first month of the year, the second month to the last month, and the first day to the last day
Undefined and null in JS
1.初步认识express
ADT Google browser plug-in ad Terminator