請(qǐng)問(wèn)我的為什么上下對(duì)不齊呀?
@charset "gb2312";
/* CSS Document */
* {
padding: 0;
margin: 0;
font-size: 12px;
}
body {
background-color: #F5F5F5;
}
.wrap {
width: 1000px;
margin: 0 auto;
}
.top {
width: 100%;
height: 27px;
background: url(../images/top_bg.jpg) repeat-x;
}
.top_content {
width: 1000px;
margin: 0 auto;
line-height: 27px;
}
.top_content li {
float: right;
list-style-image: url(../images/arrow.jpg);
width: 70px;
}
.top_content a:link, .top_content a:visited {
color: #8E8E8E;
text-decoration: none;
}
.top_content a:hover, .top_content a:active {
color: #C00;
text-decoration: none;
}
.logo {
height: 80px;
background-color: #FFF;
}
.logo_left {
width: 375px;
float: left;
display: inline;
}
.logo_right {
width: 300px;
height: 28px;
margin-top: 30px;
float: right;
display: inline;
color: #8E8E8E;
}
.logo_right img {
vertical-align: middle;
margin-right: 10px;
}
.tel {
font-family: "微軟雅黑";
font-size: 22px;
color: #C00;
}
.nav {
height: 40px;
}
.nav_left {
width: 10px;
background: url(../images/nav_left.jpg) no-repeat;
}
.nav_mid {
width: 980px;
background: url(../images/nav_bg.jpg) repeat-x;
line-height: 40px;
}
.nav_right {
width: 10px;
background: url(../images/nav_right.jpg) no-repeat;
}
.nav_left, .nav_mid, .nav_right {
height: 40px;
float: left;
display: inline;
}
.nav_mid li {
float: left;
list-style-type: none;
width: 100px;
font-family: "微軟雅黑";
text-align: center;
}
.nav_mid a:link, .nav_mid a:visited {
font-size: 16px;
color: #FFF;
text-decoration: none;
}
.nav_mid a:hover, .nav_mid a:active {
font-size: 16px;
color: #FF0;
text-decoration: none;
}
.nav_mid_left {
width: 680px;
}
.nav_mid_right {
width: 300px;
}
.nav_mid_left, .nav_mid_right {
float: left;
display: inline;
}
.search_text {
width: 190px;
float: left;
height: 25px;
margin-top: 5px;
background: url(../images/search.jpg) no-repeat right center;
background-color: #FFF;
border: 1px solid #FFF;
padding-right: 25px;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>水軍識(shí)別系統(tǒng)</title>
</head>
<link href="css/main.css" rel="stylesheet" type="text/css">
<script src="js/setHomeSetFav.js" type="text/javascript" charset="gb2312"></script>>
<body>
<div class="top">
? ? ? ?<div class="top_content">
? ? ? ? ?<ul>
? ? ? ? ? ? <li><a herf="#">聯(lián)系我們</a></li>
? ? ? ? ? ?<li><a herf="#" onclick="AddFavorite(window.location,document.title)">加入收藏</a></li><!--要收藏的網(wǎng)址,加入收藏的頁(yè)面標(biāo)題-->
? ? ? ? ? <li><a herf="#" onclick="setHome(window.location)">設(shè)為首頁(yè)</a></li>
? ? ? ? ?</ul>
? ? ? ?</div>
</div><!--top結(jié)束-->?
<div class="wrap">
? ?<div class="logo">
? ?<div class="logo_left"><img src="images/logo.jpg" /></div><!--我們的LOGO-->
? ?<div class="logo_right"><img src="images/tel.jpg" width="28" height="28" />服務(wù)熱線:<span class="tel">電話(huà)號(hào)碼</span></div>
? ?</div><!--logo結(jié)束-->
</div> <!--wrap 結(jié)束-->
<div class="nav">
? ? <div ?class="nav_left"></div>
? ? <div class="nav_mid">
? ? ? <div class="nav_mid_left">
? ? ? ? <ul>
? ? ? ? ? <li><a href="#">首頁(yè)</a></li>
? ? ? ? ? <li><a href="list.html">系統(tǒng)簡(jiǎn)介</a></li>
? ? ? ? ? <li><a href="list.html">演示</a></li>
? ? ? ? ? <li><a href="list.html">文檔下載</a></li>
? ? ? ? ? <li><a href="list.html">關(guān)于我們</a></li>
? ? ? ? </ul>
? ? ? </div>
? ? ? <!--nav_mid_left結(jié)束-->
? ? ? <div class="nav_mid_right">
? ? ? ? <form action="" method="post">
? ? ? ? ? <input type="text" class="search_text" />
? ? ? ? ? <!--<input type="text" class="search_text" x-webkit-speech />-->
? ? ? ? </form>
? ? ? </div>
? ? ? <!--nav_mid_right結(jié)束-->?
? ? </div>
? ? <!--導(dǎo)航主體nav_mid結(jié)束-->
? ? <div class="nav_right"></div>
? </div>
? <!--nav結(jié)束-->
</body>
</html>
2017-08-07
<div class="wrap">....</div>這個(gè)div你沒(méi)有包到 .nav 這個(gè)導(dǎo)航菜單,所以<!--nav結(jié)束-->后面應(yīng)該放<!--wrap結(jié)束-->