我正在 codeschool.com 上学习 CSS 课程,但我对特定代码感到困惑。我应该编辑代码来测试 CSS 的特定功能,我得到了正确的答案,但我不明白为什么代码实际上可以工作。这是html:
<!doctype html>
<html lang="en">
<head>
<title>Sven's Snowshoe Emporium</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<section id="home" class="content home group">
<aside>
<p>Did you know that Sven's Snowshoe Emporium produces the highest quality snowshoes in North America? <a href="#">Find out more</a>.</p>
</aside>
<article>
<h3>New Fall Styles</h3>
<p>Be the first at your resort to sport the hot new tennis-themed snow kicks, now available in the <a href="#">store</a>.</p>
<a class="button" href="#">See all products</a>
</article>
</section>
</body>
</html>
CSS是
.home a {
color: #c09e79;
}
article .button {
color: #fff;
}
我很困惑,因为在 html 代码中,'button' 是一个类,所以我认为它会在 CSS 中被标识为#button,而不是 .button