初学者,随便写了一个
AAA {
color:red;
background-color:blue;
}
代码调用一下
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<link rel="stylesheet" href="CSS/KKK.css" />
</head>
<body>
<form id="form1" runat="server">
<div class = "AAA" >
中国中国
</div>
</form>
</body>
</html>
最后字体颜色和背景颜色都没变,如果把名字“AAA” 改成"body ",不需要class = "AAA",整个页面都是变了背景的,字体也是变了颜色的