几周前我有一个家庭作业,在我的作业中,我要重新创建一个非常简单的网站。它完成得很快,看起来就像一个精确的复制品。但是,她说我只做了 4 种所需的标签样式中的 2 种。她表示我错过了 h2 和 h3 标签样式。这是什么意思?或者我只是愚蠢。我会问她,但今晚我还有另一项任务要交(我已经完成了),现在给她发电子邮件已经太晚了。
该网站应该是这样的:[][1]
<!DOCTYPE html>
<!--
CTI 110 - Evan Wright
-->
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> Dog Breeds </title>
<style>
body {
background-color: lightblue;
}
ol li {
color: blue;
}
.dog-breed {
color: green;
}
.dog-breed-info {
background-color: lightyellow;
}
.dog-breed-variations {
color: blue;
}
/*
Colors
*/
#yellow {
color: yellow;
}
#chocolate {
color: chocolate;
}
#white {
color: white;
}
#brindle {
color: rgb(189, 118, 92); /* kind of brownish tan I guess */
}
#fawn {
color: tan;
}
#red {
color: red;
}
#blue {
color: grey;
}
</style>
</head>
<body>
<h1> Dogs </h1>
<p> Information on dog breeds. </p>
<h2 class="dog-breed"> Labradors </h2>
<p class="dog-breed-info"> Labradors are one of the most popular breeds of dog.</p>
<h3 class="dog-breed-variations"> Colors </h3>
<ul>
<li> Black </li>
<li id="yellow"> Yellow </li>
<li id="chocolate"> Chocolate </li>
</ul>
<h2 class="dog-breed"> Chihuahuas </h2>
<p class="dog-breed-info"> Chihuahuas are the smallest breed of dogs and come in any variety of colors.</p>
<h3 class="dog-breed-variations"> Varieties </h3>
<ol>
<li> Long-Haired </li>
<li> Short-Haired </li>
</ol>
<h2 class="dog-breed"> Greyhounds </h2>
<p class="dog-breed-info"> Greyhounds are any breed of tall, slender, smooth-coated dogs.</p>
<h3 class="dog-breed-variations"> Colors </h3>
<ul>
<li id="white"> White </li>
<li id="brindle"> Brindle </li>
<li id="fawn"> Fawn </li>
<li> Black </li>
<li id="red"> Red </li>
<li id="blue"> Blue(Grey) </li>
</ul>
</body>
</html> ```
[1]: https://i.stack.imgur.com/2VgCO.png
这很难知道,但听起来它可能很简单,就像字面上没有设置 h2/h3 标签的样式一样?
我知道您在 h2/h3 标签上使用 class="..." 对它们进行了样式设置,但也许她希望您将样式应用于 HTML 标签本身?
您已经在这里实现了这一目标:
<style>
body {
background-color: lightblue;
}
</style>
您也可以对 h2 / h3 标签使用类似的方法:
<style>
h2 {
font-weight: bold;
}
h3 {
font-weight: bolder;
}
</style>
最简单的方法就是向老师请教!:)
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句