导航菜单中的内容重叠?

时间:2013-08-21 09:33:35

标签: uinavigationbar

我的导航菜单位于顶部,内容与导航菜单重叠。我想要的是内容必须在导航栏下方。如何解决这个问题?请帮帮我?

以下是截图: http://s1277.photobucket.com/user/fuscia_pink19/media/ss_zps888fc3e9.png.html

正如您所看到的那样,aaaa字母也在导航栏上。

这是我的代码:

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
body {
margin: 0;
padding: 0;
}

nav {
float: right;
position: absolute;
top: 28%;
right: 16%;
font-size: 20px;
}

nav li {
list-style: none;
display: inline;
}

nav li a {
text-decoration: none;
color: #a4d0dd;
padding: 11px 25px;
}

#wrap {
position: fixed;
left: 0;
top: 0;
background-color: black;
width: 100%;
height: 80px;
border-bottom: 1px solid #444444;
}
</style>
</head>
<body>
<div id="wrap">

<nav>
<ul>
<li>
<a href="#">Home</a>
</li>

<li>
<a href="#">My Profile</a>
</li>

<li>
<a href="#">Account</a>
</li>

<li>
<a href="#">Logout</a>
</li>
</ul>
</nav>
</div><!-- ENDING TOP_MENU DIV -->
<div class="content">
a<br />

a<br />

a<br />

a<br />

a<br />

a<br />

</div>
</body>
</html>

1 个答案:

答案 0 :(得分:0)

要在导航栏下方显示内容,您需要添加与导航栏高度相同的margin-top,在本例中为“80px”

所以你将这一行添加到你的CSS:

.content { margin-top: 80px; }