HTML5&;CSS,内部CSS样式不适用

HTML5&;CSS,内部CSS样式不适用,css,html,Css,Html,我使用的是内部css,无论何时在任何浏览器上进行测试,该样式都不会应用于标记。我已经验证了我的代码并通过了测试。我不知道哪里出了问题。 如果有人可以帮我在他的浏览器中查看此页面?谢谢 <!DOCTYPE HTML> <html> <head> <meta charset="utf-8" /> <title>Extend Your Knowledge - 3-1</title> <style type="text/c

我使用的是内部css,无论何时在任何浏览器上进行测试,该样式都不会应用于标记。我已经验证了我的代码并通过了测试。我不知道哪里出了问题。 如果有人可以帮我在他的浏览器中查看此页面?谢谢

<!DOCTYPE HTML>

<html>
<head>
<meta charset="utf-8" />
<title>Extend Your Knowledge - 3-1</title>

<style type="text/css">
<!--

body {font-family:"Garamond,Arial,Verdana; font-size:12pt;}

h1,h2 {color:red ; 
       font-variant:small-caps;}

.align-right {float:right;
              margin-left:15px;
              margin-right:15px;}

.align-left {float:left;
             margin-left:15px;
             margin-right:15px; }
a            {text-decoration:underline;
             color:red;}
a:hover      {background:red;
              color:white;}
              -->
              </style>

</head>
<body>

<section>
<article>
     <a id="top"></a>
     <h1>Isabel's Desserts</h1>
<p>We offer a variety of wonderful desserts at our cafe such as <a href="#eggnog">eggnog mousse</a> as well as <a href="#custard">decorative custards</a>.</p>

<a id="eggnog"></a>
<h2>Eggnog Mousse</h2>
<img class="align-left" src="mousse.jpg" width="560" height="420" alt="First dessert" />

<p>This first dessert is delicious. The mousse is light and fluffy and is always a customer favorite.</p>
<br style="clear-left" />
<br /> <br /><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<a href="#top">To top</a>

<a id="custard"></a>
<h2>Decorative Custards</h2>
<img class="align-right" src="custard.jpg" width="280" height="420" alt="Second dessert"  />
<p>This second dessert comes in several flavors, including chocolate, vanilla, and butterscotch. The custard is often selected as the dessert for special occasions.</p>
<br style="clear:right" />
<br/><br/>
<a href="#top">To top</a>
</article>
</section>
</body>
</html>

扩展你的知识-3-1
以及

打字错误:

body {font-family:"Garamond,Arial,Verdana; font-size:12pt;}
                                         ^-- missing "

您确实应该检查浏览器的调试控制台(例如Firefox中的shift-ctrl-j),它会告诉您这一点。css文件中的任何错误都将在错误发生后终止所有规则。由于html注释中出现语法错误,而这是
,基本上整个css规则集都被忽略了。

错误在下面一行
正文{字体系列:“Garamond,Arial,Verdana;字体大小:12pt;}

你错过了上面一行中的

试试这个
正文{字体系列:“Garamond,Arial,Verdana”;字体大小:12pt;}

删除注释也

你正在注释你的css
这些是HTML注释,在开始和结束注释之间不会有任何内容。我的另一个建议是为你的“totop”指定一个类“链接,然后对其应用
页边空白顶部
,而不是使用几十个分隔符。噢!你是对的!我删除了(“)对于字体系列和bam来说,它成功了!Idid是一个多么愚蠢的错误!我已经试了三个小时了!哈哈,非常感谢:))引号,如果要添加,应该添加在
Garamond
之后,而不是
Verdana
之后,因为否则浏览器将寻找一种名为
Garamond,Arial,Verdana的单一字体
而不是三种字体及其各自的名称。