代码:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>子选择器</title> <link rel="stylesheet" href="../css/006.css"> </head> <body> <p>p1</p> <p>p2</p> <p>p3</p> <p>p4</p> <ul> <li>p4</li> <li>p5</li> <li>p6</li> </ul> </body> </html>
/*子选择器,一代 儿子*/ body>p { background: brown; }
运行结果: