我有一个包含宽度为 100% 的图像的 div,我想将所有其他内容(将进入内容 div 的所有内容)放在它下面。这是我当前的代码:
98.214.131.200/index.php
<!DOCTYPE html>
<html>
<head>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<ul id="nav">
<li><a href="http://tri-peoria.org">Home</a></li>
<li><a href="/forum">Forum</a></li>
<li><a href="/join">Join</a></li>
<li><a href="/members">Members</a></li>
<li><a href="/events">Events</a></li>
<li><a href="/training">Training</a></li>
<li><a href="https://www.facebook.com/groups/tripeoria/">Facebook</a></li>
<ab><a href="/about">Peoria Triathlon Club</a></ab>
</ul>
<ul id="quote">
<p>"random quote"</p>
</ul>
<div id="bg"><img src="bg.jpg" width="100%" alt=""</img></div>
<div id="content">
<p>content</p>
</div>
</body>
</html>
98.214.131.200/style.css
body {
background-color: #000000;
color: #C1C1C1;
font-family: Arial,Verdana,Helvetica,sans-serif;
margin: 0;
}
#bg {
position:absolute;
top:0;
left:0;
width:100%;
}
#content {
position:relative;
color: #FFF;
}
#nav {
z-index:1;
position:relative;
width: 100%;
float: left;
margin: 0 0 3em 0;
padding: 0;
list-style: none;
background-color: #f2f2f2;
border-bottom: 1px solid #ccc;
border-top: 1px solid #ccc; }
#nav li {
float: left; }
#nav li a {
display: block;
padding: 8px 15px;
text-decoration: none;
font-weight: bold;
color: #c00;
border-right: 1px solid #ccc; }
#nav li a:hover {
color: #c00;
background-color: #fff; }
#nav ab {
float: right; }
#nav ab a {
display: block;
padding: 8px 15px;
text-decoration: none;
font-weight: bold;
color: #c00;
border-right: 1px solid #ccc; }
#nav ab a:hover {
color: #c00;
background-color: #fff; }
#quote{
z-index:1;
position:relative;
}
#quote p {
color: #000;
width: 350px;
}
你可以访问 http://98.214.131.200 查看我当前的代码。