</header>
...
<footer>
<p class="Disclaimer">These apocalyptic predictions do not reflect the views of the author.</p>
<p>
<a href="AboutUs.html">About Us</a>
...
</p>
<p>Copyright © 2014</p>
</footer>
当然,对应的 ApocalypsePage_Revised.css 文件也需要进行修改,将其中的 .Header 和 .Footer 替换为 header 和 footer 。部分代码如下:
- /*页面顶部的标题区样式*/
header {
- background-color: #7695FE; /*可接受任何颜色值*/
border: thin #336699 solid; /*多合一的 border 属性*/
- padding: 10px; /* 10像素的内边距,边框与内容之间的距离*/
margin: 10px; /* 10像素的外边距,边框与周围元素之间的距离*/
- text-align: center; /*头部文本居中*/
}
- /*页眉中标题<h1>样式*/
header h1{
- margin: 0px;
color: white;
- font-size: xx-large; /*精确控制可以用像素或者em单位*/
}
最后还有一个元素需要用在示例文件中,就是 <article> 元素,表示一个完整的、自成一体的内容。
<ariticle>元素应该包含新闻报道或文章的内容,包括标题、署名和正文。因此添加了 <article> 元素后的结构如下:
- <article>
<header>
- <h1>How the World Could End</h1>
<p class="Teaser">Scenarios that spell the end of life as we know</p>
- <p class="Byline">by Ray N. Carnation</p>
</header>
- <div class="Content">
<p><span class="LeadIn">Right now</span>, you're probably feeling pretty good. After all, life in the developed world is comfortable<span class="style1">—</span>probably more comfortable than it's been for the average human being throughout all of recorded history.</p>