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

HTML+CSS Easy to Get Started with ID Selector

In some ways, ID selectors are similar to class selectors, but there are some important differences

Syntax:

# id name{

Style

}

Case Sensitive

Please note that class selectors and ID selectors may be case sensitive. This depends on the language of the document. HTML and XHTML define class and ID values ??to be case-sensitive, so the case of class and ID values ??must match the corresponding values ??in the document

Example:

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>ID選擇器</title>
	<style type="text/css">
			#div{
				color:green;
				font-family:隸書;
				font-size:18px;
			}
	</style>
</head>
<body>
		<div id="div">中華民族偉大復(fù)興!</div>
</body>
</html>

id selectors and classes What is the difference between selectors

  1. Unlike classes, ID selectors will be used once and only once in an HTML document.

  2. Unlike class selectors, ID selectors cannot be used together because the ID attribute does not allow a space-separated list of words.

    For example: <div class ="class1 class2 class2"></div>That is to say, class can be equal to a list of multiple classes
    Write id = "div1 div2", that is, there can only be one id, not like the class attribute

Continuing Learning
||
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>ID選擇器</title> <style type="text/css"> #div{ color:green; font-family:隸書; font-size:18px; } </style> </head> <body> <div id="div">中華民族偉大復(fù)興!</div> </body> </html>
submitReset Code