亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

neighbor sibling selector

This selector can match elements immediately adjacent to the specified element.

E + F

The above code is the format for creating a sibling selector.

E + F Adjacent sibling selector Selects the element that matches F, and this element is the adjacent position behind the matched E element.

E and F must have the same parent element, and F must be behind and adjacent to E. The code example is as follows:

<!DOCTYPE html>
<html>
<head>
<meta charset=" utf-8">
<meta name="author" content="http://ask.php.cn/" />
<title>php中文網(wǎng)</title>
<style type="text/css">
li{color:blue}
.antzone+li{
  color:red;
}
</style>
</head>
<body>
<ul>
  <li>php中文網(wǎng)一</li>
  <li class="antzone">php中文網(wǎng)二</li>
  <li>php中文網(wǎng)三</li>
  <li>php中文網(wǎng)四</li>
</ul>
</body>
</html>

The above code can antzone the font of the immediately adjacent li element. The color is set to red.

Continuing Learning
||
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="author" content="http://ask.php.cn/" /> <title>CSS的相鄰選擇符</title> <style type="text/css"> div+p{ color: #cfff2e } </style> </head> <body> <div>php中文網(wǎng)一</div> <p>php中文網(wǎng)二</p> <span>php中文網(wǎng)三</span> <p>php中文網(wǎng)四</p> </body> </html>
submitReset Code