我的 HTML 和 CSS 代码有一个奇怪的问题:
<header>
<h1>title</h1>
</header>
<nav>
<a href="">menu 1</a>
<a href="">menu 1</a>
<a href="">menu 1</a>
<a href="">menu 1</a>
</nav>
header {
margin: 0 auto;
position: relative;
top: 200px;
width: 200px;
}
header h1 {
font-size: 24px;
text-align: center;
}
nav {
clear: both;
margin: 0 auto;
position: relative;
width: 200px;
}
* {
border: none;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary {
display: block;
}
body, html {
height: 100%;
}
当它们都相对定位时,为什么会<nav>
出现在上面?<header>