不知道哪里出錯(cuò)了?我是跟著老師做的,就是找不出什么原因?qū)е? 新聞板塊的 title_left和title_right在同一行上,其他效果都能實(shí)現(xiàn)。。
<!-------------以下是HTML文檔--------------!>
<!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>無(wú)標(biāo)題文檔</title>
<link href="css/main.css" rel="stylesheet" type="text/css" />
<script src="js/setHomeSetFav.js" type="text/javascript" charset="gb2312"></script>
<script src="js/myfocus-2.0.1.min.js" type="text/javascript"></script>
<script src="js/mf-pattern/mF_fancy.js" type="text/javascript"></script>
<link href="js/mf-pattern/mF_fancy.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
myFocus.set({id:"picBox"})
</script>
</head>
<body>
<div class="top">
? ? <div class=top_content>
? ? ? ?<ul>
? ? ? ? ? <li><a href="#">聯(lián)系我們</a></li>
? ? ? ? ? <li><a href="#" onclick="AddFavorite(window.location,document.title)">加入收藏</a></li>
? ? ? ? ? <li><a href="#" 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="imge/logo.jpg" alt="慕課網(wǎng)" />
? ? ? ? </div>
? ? ? ? <div class="logo_right">
? ? ? ? ? ? <img src="imge/tel.jpg" alt="服務(wù)熱線" />24小時(shí)服務(wù)熱線:<span class="tel">123-456-7890</span>
? ? ? ? </div>
? ? </div><!--logo結(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">關(guān)于慕課</a></li>
? ? ? ? ? ? ? ? ? <li><a href="list.html">新聞動(dòng)態(tài)</a></li>
? ? ? ? ? ? ? ? ? <li><a href="list.html">課程中心</a></li>
? ? ? ? ? ? ? ? ? <li><a href="list.html">在線課程</a></li>
? ? ? ? ? ? ? ? ? <li><a href="list.html">人才招聘</a></li> ? ? ? ? ? ??
? ? ? ? ? ? ? </ul>
? ? ? ? ? ? </div> ?
? ? ? ? ? <div class="nav_mid_right">
? ? ? ? ? ? ? ?<form action="" method="post">
? ? ? ? ? ? ? ? ? <input type="text" class="search_text" />
? ? ? ? ? ? ? ?</form>
? ? ? ? ? </div>
? ? ? ?</div><!--nav_mid結(jié)束-->
? ? ? ?<div class="nav_right">
? ? ? ? ??
? ? ? ?</div>
? ? </div><!--nav結(jié)束-->
? ? <div class="ad" id="picBox">
? ? ? <div class="loading"><img src="imge/loading.gif" alt="圖片加載中"/></div>
? ? ? ?<div class="pic">
? ? ? ? ? ?<ul>
? ? ? ? ? ? ? ? <li><img src="imge/ad2.jpg" /></li>
? ? ? ? ? ? ? ? <li><img src="imge/ad3.jpg" /></li>
? ? ? ? ? ? ? ? <li><img src="imge/ad4.jpg" /></li>
? ? ? ? ? ?</ul>
? ? ? ?</div>
? ? </div><!--ad結(jié)束-->
? ? <div class="main">
? ? ? ? <div class="news">
? ? ? ? ? ? ?<div class="title">
? ? ? ? ? ? ? ? ? <h2 class="title_left">新聞中心</h2>
? ? ? ? ? ? ? ? ? <span class="title_right"><a href="news.html">More>></a></span>
? ? ? ? ? ? ?</div>
? ? ? ? ? ? ?<div class="pic_news">
? ? ? ? ? ? ? ? ? <img src="imge/news.jpg" /><h2>哎呦 有人再向你表白哦!</h2>
? ? ? ? ? ? ? ? ? <p>活動(dòng)時(shí)間:5月20日——5月26日<br />獲獎(jiǎng)公布時(shí)間:5月26日<br />Learn More>></p>
? ? ? ? ? ? ?</div><!--pic_news結(jié)束-->
? ? ? ? ? ? ?<div class="news_list">
? ? ? ? ? ? ? ? ? ? <ul>
? ? ? ? ? ? ? ? ? ? ? <li><span>2014-06-01</span> <a href="news.html">【慕客訪談 用戶篇】“有為屌絲”在路上</a></li>
? ? ? ? ? ? ? ? ? ? ? <li><span>2014-06-01</span><a href="news.html">【有獎(jiǎng)活動(dòng)】給父親的三行書信</a></li>
? ? ? ? ? ? ? ? ? ? ? <li><span>2014-05-30</span><a href="news.html">《程序猿,請(qǐng)曬出你的童年》活動(dòng)獲獎(jiǎng)公告</a></li>
? ? ? ? ? ? ? ? ? ? ? <li><span>2014-05-28</span><a href="news.html" title="aa">【慕課訪談】破繭成蝶——美女程序員的蛻變史</a></li>
? ? ? ? ? ? ? ? ? ? </ul>
? ? ? ? ? ? ?</div><!--news_list結(jié)束-->
? ? ? ? </div><!--news結(jié)束-->
? ? ? ? <div class="course"></div><!--course結(jié)束-->
? ? ? ? <div class="sidebar"></div><!--sidebar結(jié)束--> ? ? ??
? ? </div>
</div><!--wrap結(jié)束-->
</body>
</html>
<!-------------------------------------------以下是CSS文檔------------------------------------!>
@charset "utf-8";
/* CSS Document */
*
{
margin:0;
padding:0;
font-size:12px;
}
body
{
background-color:#f5f5f5;
}
.wrap
{
width:1000px;
margin:0 auto;
}
.top
{
width:100%;
height:27px;
background:url(../imge/top_bg.jpg) repeat-x;
}
.top_content
{
width:1000px;
margin:0 auto;
}
.top_content li
{
list-style-image:url(../imge/li_bg.gif);
float:right;
width:70px;
line-height:27px;
}
.top_content a:link,.top_content a:visited
{
color:#8e8e8e;
text-decoration:none;
}
.top_content a:hover,.top_content a:active
{
color:#900;
text-decoration:none;
}
.logo
{
height:80px;
background-color:#FFF;
}
.logo_left
{
width:200px;
float:left;
}
.logo_right
{
width:300px;
float:right;
height:28px;
margin-top:30px;
color:#8e8e8e;
}
.logo_right img
{
vertical-align:middle;
margin-right:10px;
}
.tel
{
font-family:微軟雅黑;
font-size:18px;
color:#C00;
}
.nav
{
height:40px;
}
.nav_left
{
width:10px;
background:url(../imge/nav_left.jpg) no-repeat;
/*background-image:url(../imge/nav_left.jpg);
background-repeat:no-repeat;*/
}
.nav_mid
{
width:980px;
background:url(../imge/nav_bg.jpg) repeat-x;
}
.nav_right
{
width:10px;
background:url(../imge/nav_right.jpg) no-repeat;
}
.nav_left,.nav_mid,.nav_right
{
float:left;
height:40px;
}
.nav_mid_left,.nav_mid_right
{
float:left;
}
.nav_mid_left
{
width:680px;
}
.nav_mid_right
{
width:300px;
}
.nav_mid_left li
{
float:left;
list-style-type:none;
width:100px;
text-align:center;
line-height:40px;
}
.nav_mid_left a:link,.nav_mid_left a:visited
{
text-decoration:none;
color:#FFF;
font-size:16px;
font-family:微軟雅黑;
}
.nav_mid_left a:hover,.nav_mid_left a:active
{
text-decoration:none;
color:#FF0;
font-size:17px;
font-family:微軟雅黑;
}
.search_text
{
width:190px;
height:25px;
margin-top:6px;
background:url(../imge/search.jpg) no-repeat right center;
/*background-image:url(../imge/search.jpg);
background-repeat:no-repeat;
background-position:right center;*/
background-color:#FFF;
padding-right:25px;
border:1px solid #FFFFFF;?
}
.ad
{
height:310px;
overflow:hidden;
}
.main
{
height:250px;
background-color:#FFF;
margin-top:5px;
}
.news
{
width:340px;
}
.course
{
width:410px;
border:1px solid #8E8E8E;
background-color:#FF0;
margin:0 7px;
}
.sidebar
{
width:230px;
background-color:#00F;
}
.news,.course,.sidebar
{
height:250px;
float:left;
}
.title
{
height:35px;
border-bottom:2px solid #e8e8e8;
}
.title_left
{
width:70%;
font-family:"微軟雅黑";
font-size:14px;
font-weight:bold;
color:#786f66;
float:letf;
line-height:35px;
padding-left:20px;
}?
.title_right
{
width:15%;
float:right;
line-height:right;
padding-bottom:5px;
}
.title_right a
{
text-decoration:none;
color:#999999;
}
2015-07-03
你的代碼中有一個(gè)單詞寫錯(cuò)了 float:left 而不是 float:letf