Home > front end >  Question: why is a subclass of CSS selector and future generations in the generations of offspring t
Question: why is a subclass of CSS selector and future generations in the generations of offspring t

Time:10-15

The code


<meta charset="utf-8" & gt;
<meta name="viewport" content="width=device - width, initial - scale=1.0" & gt;
Document
<style>
Div> . A1 & gt; The a2 {
Width: 500 px;
Height: 500 px;
Background - color: maroon;
}

. A1 & gt; The a2 & gt; The a3 {
width: 400px;
Height: 400 px;
Background - color: magenta.
}

The a2 & gt; The a3 & gt; The a4 {
width: 300px;
Height: 300 px;
Background - color: mediumpurple;
}

The a3 & gt; The a4 & gt; A5 {
Width: 200 px;
Height: 200 px;
Background - color: mediumslateblue;
}

A1: hover,
A2: hover,
A3: hover,
A4: hover {
width: 600px;
Height: 600 px;
}
</style>

<body>









CodePudding user response:

Well, the first post, please forgive me not to do

CodePudding user response:

Hover in the code to the
 
A1: hover,
Div> . A1 & gt; A2: hover,
. A1 & gt; The a2 & gt; A3: hover,
The a2 & gt; The a3 & gt; A4: hover {
width: 600px;
Height: 600 px;
}

CSS selectors enough lead to priority style is not effective,

More may refer to: https://www.cnblogs.com/zxjwlh/p/6213239.html
  • Related