html
1<!DOCTYPE html> 2<html> 3 <head> 4 <meta charset="UTF-8"> 5 <link rel="stylesheet" type="text/css" href="xxx.css"> 6 </head> 7 <body> 8 <div class="xxx"> 9 <p>赤は適応されない</p> 10 </div> 11 12 <p>普通に赤</p> 13 14 <div class="green"> 15 <p>ここは緑(何故か赤になる)</p> 16 </div> 17 18 </body> 19</html>
css
1p:not(.xxx p){ 2 color: red; 3} 4 5.green p{ 6 color: green; 7} 8
p:not(.xxx p)で.xxxのpタグは赤が適用されないようにしてあります。
.greenのpタグに緑を指定して赤になるのはどうしてですか。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2024/04/23 08:15
2024/04/23 08:19