当前位置:网站首页>Priority issues
Priority issues
2022-06-12 08:41:00 【Little boy who likes hot pot】
1. The weight is 4 Groups of numbers make up , But there will be no carry
2. Rank judgment from left to right , If the values of a certain class are the same , Then judge the next numerical value
3. A simple way to remember : Wildcard and inheritance weights are 0, class ( pseudo-classes ) Selector for 10,id Selectors 100, The inline style sheet is 1000,!important infinity
*4. The inherited weight is 0, If the element is not directly selected , No matter how heavy the parent element is , The weight of the child element is 0
a key : For example, the weight of a father is 100,p The inherited weight is 0, So the style is p Medium ( Inherit ) Color
Code :
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS The weight </title>
<style>
/* Father's weight is 100 */
#father{
color:pink;
}
/* p The inherited weight is 0,*/
p{
color: red ;
}
</style>
</head>
<body>
<div id="father">
<p>CSS The weight </p>
</div>
</body>
</html> Running effect :
Even if the father style is followed by !important It doesn't work ,p The inherited weight is 0, When p When writing styles in , The weight of 1, So the style is p
Which style does the label execute , Let's see if this label is directly selected
5. Change label style 、
Code :
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS The weight </title>
<style>
/* Father's weight is 100 */
#father{
color:pink;
}
/* p The inherited weight is 0,*/
p{
color: red ;
}
body{
color: red;
}
a{
color: green;
}
</style>
</head>
<body>
<div id="father">
<p>CSS The weight </p>
</div>
<a href="#"> I'm a separate style </a>
</body>
</html>Running effect :

边栏推荐
- How to understand the production scheduling of APS system?
- Code generation tool Autocode for XML Publishing
- [new planning]
- Callback webrtc underlying logs to the application layer
- Where does the driving force of MES system come from? What problems should be paid attention to in model selection?
- Shell基本语法--算数运算
- Hypergeometric cumulative distribution test overlap
- When converting tensor to ndarray in tensorflow, the run or Eval function is constantly called in the loop, and the code runs more and more slowly!
- MES helps enterprises to transform intelligently and improve the transparency of enterprise production
- Hands on deep learning -- image classification dataset fashion MNIST
猜你喜欢

QT realizes multi screen and multi-resolution adaptation

Engineers learn music theory (I) try to understand music

(p19-p20) delegate constructor (proxy constructor) and inheritance constructor (using)

In the era of intelligent manufacturing, how do enterprises carry out digital transformation

svg中viewbox图解分析

Hypergeometric cumulative distribution test overlap

(p17-p18) define the basic type and function pointer alias by using, and define the alias for the template by using and typedef

三国杀周边--------猪国杀题解

Close asymmetric key

What should be paid attention to when establishing MES system? What benefits can it bring to the enterprise?
随机推荐
Call method and apply method
正则校验用户名
【数据存储】浮点型数据在内存中的存储
2022.6.11-----leetcode. nine hundred and twenty-six
[GUI development] browsing function implementation model of image processing software
JVM learning notes: three local method interfaces and execution engines
Never use MES as a tool, or you will miss the most important thing
Query in MySQL
Hands on learning and deep learning -- simple implementation of linear regression
QT realizes multi screen and multi-resolution adaptation
余压监控系统保证火灾发生时消防疏散通道的通畅,为大型高层建筑的安全运行和人民生命财产安全保驾护航
Hands on deep learning -- concise implementation code of weight decay
What kind of sparks will be generated when the remote sensing satellite meets the Beidou navigation satellite?
Close asymmetric key
[open source project] easycmd command graphical software
MSTP的配置与原理
Wechat applet image saving function
Webrtc series - mobile terminal hardware coding supports simulcast
Code generation tool Autocode for XML Publishing
Error: ER_ NOT_ SUPPORTED_ AUTH_ MODE: Client does not support authentication protocol requested ... ...