HTML+CSS Easy to Get Started with Selectors
What is the inclusion selector
The inclusion selector, that is, adding spaces, is used to select descendant elements under the specified label element
Syntax:
body div{
Style
}
Example:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>包含選擇器</title> <style type="text/css"> body div li{ color:red; } </style> </head> <body> <div>中華民族偉大復(fù)興! <ul> <li>中國</li> <li>中國</li> </ul> </div> <p>你知道我的夢(mèng),知道我的痛,知道我們感受都相同</p> <span>最美的太陽 <p>強(qiáng)軍夢(mèng)</p> </span> <h3>中國夢(mèng)</h3> </body> </html>
If I want to set the font of "Strong Army Dream" to size 20 , the color is blue, what should be done
Add the following code to the css:
body span p{
font-size:20px;
color:blue;
}