关于header和footer
老师,请问css样式中body>header 和body>header *有什么区别?比如如下代码:
<!DOCTYPE html>
<html>
<head>
<title>header和footer</title>
<meta charset="utf-8">
<style type="text/css">
h1,h2,h3{
background-color: grey;
color:white;
}
hgroup > h1{
margin-bottom: 0px;
margin-top: 0;
}
hgroup > h2{
margin-bottom: 0;
margin-top: 0;
background-color: grey;
color:white;
font-size:1em;
}
body > header *,footer>*{
background:transparent;
color:black;
}
body > section,body>section>section,body>section>section>section{
margin-left: 10px;
}
body>header,body>footer{
border:medium solid black;
padding-left: 5px;
margin:10px 0 10px 0;
}
</style>
</head>
<body>
<header>
<hgroup>
<h1>Things I like</h1>
<h2>by Adam Freman</h2>
</hgroup>
</header>
<section>
<header>
<hgroup>
<h1>Friuts I like</h1>
<h2>how I learned to love you</h2>
</hgroup>
</header>
I like apples and oranges,
<section>
<h1>Additional fruits</h1>
<section>
<h1>More information</h1>
</section>
</section>
</section>
<section>
<header>
<h1>Activities I like</h1>
</header>
<section>
<h1>kinds of Triathlon</h1>
<section>
<h1>The kinds of Triathlon I am aiming for</h1>
</section>
</section>
</section>
<footer id="mainFooter">
©2011,Adam Freman.
</footer>
</body>
</html>
正在回答 回答被采纳积分+1
- 参与学习 人
- 提交作业 11218 份
- 解答问题 36713 个
从一个不会编程的小白到一个老司机是需要过程的,首先得入门,学习基础知识,然后才能进阶,最后再到精通,本专题是你走进前端世界的不二选择!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星