02-CSS基础与进阶-day4_2018-08-31-22-09-21

博客分享了08权重精华题.html、09权重精华题2.html、10权重精华题3.html等文件,并给出转载来源https://www.cnblogs.com/HiJackykun/p/11047714.html 。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

08权重精华题.html

 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style type="text/css">
       #fa #son {
             color: blue;
       }

       #fa p.c2 {
             color: black;
       }

       #fa{
             color: red!important; /* 继承权重为0*/
       }
    </style>
</head>
<body>
    <div id="fa" class="c1">
        <p id="son" class="c2">猜猜我啥颜色</p>
    </div>
</body>
</html>

 

09权重精华题2.html

 

 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style type="text/css">
       #fa {
             color: red;
       }

       p {
             color: green;
       }
    </style>
</head>
<body>
    <div id="fa">
        <p>猜猜我啥颜色</p>
    </div>
</body>
</html>

 

10权重精华题3.html

 

 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style type="text/css">
       /*0 0 2*/
       div p {
             color: red;
       }

       #fa {
              color: green;
       }
       
       /*0 1 1*/
       p.c2 {
              color: blue;
       }
    </style>
</head>
<body>
    <div id="fa" class="c1">
        <p id="son" class="c2">猜猜我啥颜色</p>
    </div>
</body>
</html>

 

转载于:https://www.cnblogs.com/HiJackykun/p/11047714.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值