后代选择器,选择elment1元素内部的element2元素
element1 element2
{
CSS 样式;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>NTHOME-零基础入门学习Web(HTML5+CSS3)</title>
<style>
div p{
color: green;
}
</style>
</head>
<body>
<div>
<h1 class="important">Welcome to nitian.web3v.vip</h1>
</div>
<div>
<p id="important">Welcome to nitian.web3v.vip</p>
</div>
<p>Welcome to nitian.web3v.vip</p>
<p>Welcome to nitian.web3v.vip</p>
</body>
</html>
Welcome to nitian.web3v.vip
Welcome to nitian.web3v.vip
Welcome to nitian.web3v.vip
表格中的数字表示支持该属性的第一个浏览器版本号。
Safari | Chrome | FireFox | IE |
1.0 | 1.0 | 1.0 | 5.0 |