后代选择器

后代选择器(重点)
写法:选择器+空格+...+选择器{属性:值}
特点:无限隔代.
   只要能代表标签,标签、类选择器、ID选择器的自由组合。

 1 <!DOCTYPE html>
 2 <html lang="en">
 3 <head>
 4     <meta charset="UTF-8">
 5     <title>Document</title>
 6     <style type="text/css">
 7         .box .hot{
 8                 color: #999999;
 9                 font-size: 40px;
10         }
11             div span{
12         background-color: pink;
13         width: 80px;
14         height: 80px;
15         }
16         div p {
17             background-color: blue;
18             width: 200px;
19             height: 100px;
20             font-size: 10px;
21         }
22     </style>
23 </head>
24 <body>
25     <div class="box">
26     <p><span class="hot">今天天气很清爽呀</span></p>
27 </div> 
28     <div><p>夏威夷果</p></div>
29     </body>
30 </html>

猜你喜欢

转载自www.cnblogs.com/twinkle-/p/9055331.html