1、CSS element>element Selector
版本:css2
用法:选取当前父元素的直接子元素
支持版本:
pc:ie7+、all chrome versions、all firefox versions、all safair versions、all opera versions
mobile:all ios safair versions、all opera mini versions、all Android Browser versions
eg:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS element>element Selector</title>
<style id="jsbin-css">
div>p
{
background-color:yellow;
}
</style>
</head>
<body>
<h1>Welcome to My Homepage</h1>
<div>
<h2>My name is Donald</h2>
<p>yellow1</p>
<p>yellow2</p>
</div>
<div>
<span><p>I will not be styled.</p></span>
</div>
<p>My best friend is Mickey.</p>
</body>
</html>
预览地址:http://jsbin.com/yacoba/1