12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- <!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>
- *{
- margin: 0;
- padding: 0;
- }
- /* 关系选择符 */
- /* div + p {
- background: red;
- } */
- /* div ~ p {
- background: red;
- } */
- /* 属性选择器 */
- /* li[class]{
- background: red;
- } */
- /* li[class='aaa']{
- background: red;
- } */
- /* li[class~='a']{
- background: red;
- } */
- /* 以a为首个字母 */
- /* li[class^='a']{
- background: red;
- } */
- /* li[class*='a']{
- background: red;
- } */
- /* li[class$='b']{
- background: red;
- } */
- /* li:last-child{
- background: red;
- } */
- /* li:nth-child(4){
- background: red;
- } */
- /* li:nth-child(even){
- background: red;
- } */
- /* li:nth-child(odd){
- background: orange;
- } */
- #div1::after {
- content: 'xixixi';
- background: pink;
- }
- #div1::before{
- content: 'hahahhah';
- background: green;
- }
- </style>
- </head>
- <body>
- <!--
- id选择器
- class选择器
- 元素选择器
- 关系选择器
- 属性选择器
- 伪类选择器
- -->
- <p>000000000</p>
- <div>111111111</div>
- <div>xxxxxxxx</div>
- <p>2222222222</p>
- <p>3333333333</p>
- <p>4444444444</p>
- <br>
- <ul>
- <li class="aabb">11111</li>
- <li>22222</li>
- <li class="ba">33333</li>
- <li>44444</li>
- <li class="aaa">55555</li>
- <li class="bbb">66666</li>
- <li class="ab">777777</li>
- <li>8888</li>
- <li class="a">999999</li>
- <li class=" a b">00000</li>
- <div id="div1">哈哈哈哈哈哈哈哈哈</div>
- </ul>
- </body>
- </html>
|