【发布时间】:2017-05-19 05:55:01
【问题描述】:
我在一些 CSS 初学者的东西上遇到了困难。我目前正在学习 CodeAcademy CSS 课程,但我有一个疑问:
.review {
background-color: #E6EBF5; /* pale blue */
border: 1px solid #003399; /* dark blue */
}
p.review {
font-style: italic;
color: red;
}
<!DOCTYPE html>
<html>
<head>
<title>MyWebPage</title>
<link href="https://fonts.googleapis.com/css?family=Oswald" rel="stylesheet">
<link href= "style.css" type= "text/css" rel="stylesheet">
</head>
<body>
<div class="review">
<h2>The Godfather</h2>
<p>The Godfather (1972) is the greatest movie of all time,
according to numerous surveys of movie critics and audiences alike.</p>
<p>The Godfather is... (your review here)</p>
</div>
<div class="review">
<h2>Avatar</h2>
<p>Avatar (2009) is the highest grossing film of all time,
earning approximately $2.8 billion.</p>
<p>Avatar is... (your review here)</p>
</div>
</body>
</html>
据我了解,使用p.review 命令我应该使用review 类设置所有<p> 元素的样式,但似乎并非如此。希望有人可以向我解释这一点。
【问题讨论】:
-
发生了什么?你期待什么输出,你得到什么?
标签: html css class tags elements