博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
每日分享{ 选择器}
阅读量:38313 次
发布时间:2022-01-23

本文共 1191 字,大约阅读时间需要 3 分钟。

<!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>Document</title>

    <style>

        .wrap div [class=box1]{

            color: brown;

        }

        .wrap p [class=box1]{

            color: blue;

        }

        .wrap input[type=text]{

            color: aqua;

        }

        ol li:nth-child(2n+1){

            background-color: blue;

        }

        ol p:nth-child(2){

            background-color: brown;

        }

        ol div:nth-child(6){

            background-color: darkblue;

        }

    </style>

</head>

<body>

    <div class="wrap">

        <div class="box1"></div>

        <p class="box1"></p>

        <div class="box2">222</div>

        <div class="box3">333</div>

        <div class="box4">444</div>

        <input type="text" value="文本">

        <div class="box1"></div>

        <p class="box1"></p>

        <div class="box2">222</div>

        <div class="box3">333</div>

        <div class="box4">444</div>

        <input type="text" value="文本">

        <div class="box1"></div>

        <p class="box1"></p>

        <div class="box2">222</div>

        <div class="box3">333</div>

        <div class="box4">444</div>

        <input type="text" value="文本">

        <div class="box1"></div>

        <p class="box1"></p>

        <div class="box2">222</div>

        <div class="box3">333</div>

        <div class="box4">444</div>

        <input type="text" value="文本">

    </div>

</body>

</html>

转载地址:http://qweuuy.baihongyu.com/

你可能感兴趣的文章
Hibernate与MyBatis区别
查看>>
如何禁用Eclipse的Validating
查看>>
据说看完这21个故事的人,30岁前都成了亿万富翁。你是下一个吗?
查看>>
SpringMVC学习笔记2
查看>>
Oracle知识点连载(一)
查看>>
Oracle知识点连载(二)
查看>>
Oracle知识点连载(三)
查看>>
Oracle知识点连载(五)
查看>>
关于三元运算符的类型转换问题
查看>>
笔记本怎么设置WIfi热点
查看>>
如何实现字符串的反转及替换?
查看>>
Java面试题全集(上)
查看>>
Java面试题全集(中)
查看>>
值传递和引用传递
查看>>
什么情况下用+运算符进行字符串连接比调用StringBuilder对象的append方法连接字符串性能更好?
查看>>
怎么根据Comparable方法中的compareTo方法的返回值的正负 判断升序 还是 降序?
查看>>
理解事务的4种隔离级别
查看>>
常用正则匹配符号
查看>>
建议42: 让工具类不可实例化
查看>>
Java 异步机制与同步机制的区别
查看>>