国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

id selector

Definition and usage of id selector:

Grammar structure one:

#myid{ Rules }

This grammar structure can select id is the element of myid.

Grammar structure two:

E#myid{ sRules }

This grammar structure can select the E element with the id myid.

Example code:

<!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">
#mytest{
  color:blue;
}
</style>
</head>
<body>
<div>
  <ul>
    <li id="mytest">php中文網(wǎng)歡迎您</li>
    <li>php中文網(wǎng)</li>
  </ul>
  <p id="mytest">php中文網(wǎng)歡迎您</p>
</div>
</body>
</html>

The code can set the text color of the element with the id mytest to blue.

Special Note: The id should be unique in the entire html document, but in the document below there are two elements with the same id, but the effect we want is still achieved, but in our actual operation We must put an end to this phenomenon.

<!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#mytest{
  color:blue;
}
</style>
</head>
<body>
<div>
  <ul>
    <li id="mytest">php中文網(wǎng)歡迎您</li>
    <li>php中文網(wǎng)</li>
  </ul>
  <p>php中文網(wǎng)歡迎您</p>
</div>
</body>
</html>

The code can set the text color in the li element with the id mytest to blue.


Continuing Learning
||
<!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#mytest{ color:blue; } </style> </head> <body> <div> <ul> <li id="mytest">php中文網(wǎng)歡迎您</li> <li>php中文網(wǎng)</li> </ul> <p>php中文網(wǎng)歡迎您</p> </div> </body> </html>
submitReset Code