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

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