課程
/前端開發(fā)
/HTML/CSS
/企業(yè)網(wǎng)站綜合布局實戰(zhàn)
日期字號比較大 ? 需要在news-list span里面重新設(shè)置 ?老師只寫了顏色和右浮動 ?請問是怎么回事
2016-05-18
源自:企業(yè)網(wǎng)站綜合布局實戰(zhàn) 3-12
正在回答
連個截圖都不給嗎。。截取對應(yīng)區(qū)域的代碼。其他人也好比較嘛
還有這個DIV里的包裹順序是這樣的。你是不是復(fù)制了其他小伙伴留言里的代碼片段了?
<div class="news-list">
? ? ? ? ? ? <ul>
? ? ? ? ? ? ? ? <li><a href="#"></a><span></span></li>
? ? ? ? ? ? </ul>
?</div>
<!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>無標題文檔</title>
<script src="../my focus/js/myfocus-2.0.1.min.js" type="text/javascript"></script>
<script src="../my focus/js/mf-pattern/mF_YSlider.js" type="text/javascript"></script>
<link href="../my focus/js/mf-pattern/mF_YSlider.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
myFocus.set({
id:'picBox'}
)
</script>
<style type="text/css">
*{
margin:0;
padding:0;
font-size:12px;
}
body{
background-color:#F5F5F5;
.top{
width:100%;
height:27px;
background:url(../../%E6%85%95%E8%AF%BE%E7%BB%83%E4%B9%A0/%E4%BC%81%E4%B8%9A%E7%BD%91%E7%AB%99%E5%AE%9E%E8%B7%B5%EF%BC%88%E6%BA%90%E4%BB%A3%E7%A0%81%EF%BC%89/images/top_bg.jpg)repeat-x;
.top-content{
width:1000px;
margin:0 auto;
.top-content li{
list-style-image:url(../../%E6%85%95%E8%AF%BE%E7%BB%83%E4%B9%A0/%E4%BC%81%E4%B8%9A%E7%BD%91%E7%AB%99%E5%AE%9E%E8%B7%B5%EF%BC%88%E6%BA%90%E4%BB%A3%E7%A0%81%EF%BC%89/images/li_bg.gif);
width:70px;
float:right;
line-height:27px;
.wrap{
.logo{
height:80px;
background:white;
.logo-left{
width:200px;
float:left;
.logo-right{
width:300px;
height:28px;
margin-top:30px;
color:#8E8E8E;
.logo-right img{
vertical-align:middle;
margin-right:10px;
span{
font-family:"Microsoft YaHei UI";
font-size:16px;
color:red;
.nav{
height:40px;
.nav-left{
width:10px;
background:url(../../%E6%85%95%E8%AF%BE%E7%BB%83%E4%B9%A0/%E4%BC%81%E4%B8%9A%E7%BD%91%E7%AB%99%E5%AE%9E%E8%B7%B5%EF%BC%88%E6%BA%90%E4%BB%A3%E7%A0%81%EF%BC%89/images/nav_left.jpg) no-repeat;
.nav-mid{
width:980px;
background:url(../../%E6%85%95%E8%AF%BE%E7%BB%83%E4%B9%A0/%E4%BC%81%E4%B8%9A%E7%BD%91%E7%AB%99%E5%AE%9E%E8%B7%B5%EF%BC%88%E6%BA%90%E4%BB%A3%E7%A0%81%EF%BC%89/images/nav_bg.jpg) repeat-x;
.nav-right{
background:url(../../%E6%85%95%E8%AF%BE%E7%BB%83%E4%B9%A0/%E4%BC%81%E4%B8%9A%E7%BD%91%E7%AB%99%E5%AE%9E%E8%B7%B5%EF%BC%88%E6%BA%90%E4%BB%A3%E7%A0%81%EF%BC%89/images/nav_right.jpg) no-repeat;
.nav-left,.nav-mid,.nav-right{
.nav-mid-left,.nav-mid-right{
.nav-mid-left{
width:680px;
.nav-mid-right{
.nav-mid-left li{
list-style:none;
width:100px;
text-align:;
line-height:40px;
.nav-mid-left a:link,.nav-mid-left a:visited{
text-decoration:none;
color:#FFF;
.nav-mid-left a:hover,.nav-mid-left a:active{
color:#FF0;
.search-text{
width:190px;
height:25px;
margin-top:5px;
background:url(../../%E6%85%95%E8%AF%BE%E7%BB%83%E4%B9%A0/%E4%BC%81%E4%B8%9A%E7%BD%91%E7%AB%99%E5%AE%9E%E8%B7%B5%EF%BC%88%E6%BA%90%E4%BB%A3%E7%A0%81%EF%BC%89/images/search.jpg) no-repeat right center;
padding-right:25px;
background-color:#FFF;
border:1px solid #FFF;
.ad{
height:310px;
overflow:hidden;
.main{
height:250px;
background:#FFF;
.news{
width:340px;
border:1px solid #E8E8E8;
.course{
width:410px;
margin:0 7px;
.sidebar{
width:230px;
.news,.course,.sidebar{
.title{
height:35px;
border-bottom:1px solid #E8E8E8;
.title-left{
width:70%;
font-size:14px;
line-height:35px;
font-weight:bold;
color:#786F66;
padding-left:20px;
.title-right{
width:20%;
.title-right a{
color:#999999;
.pic-news{
margin-top:10px;
line-height:22px;
.pic-news img{
margin:0 5px;
.pic-news a{
color:#C00;
.news-list{
margin-top:20px;
.news-list li{
list-style-type:none;
background:url(../../%E6%85%95%E8%AF%BE%E7%BB%83%E4%B9%A0/%E4%BC%81%E4%B8%9A%E7%BD%91%E7%AB%99%E5%AE%9E%E8%B7%B5%EF%BC%88%E6%BA%90%E4%BB%A3%E7%A0%81%EF%BC%89/images/list.jpg)no-repeat;
padding-left:10px;
margin:8px;
border-bottom:1px dotted #CCC;
.news-list a:link,.news-list a:visited{
color:#000;
.news-list a:hover,.news-list a:active{
color:#F00;
.news-list span{
color:#999;
</style>
</head>
<body>
<div class="top">
<div class="top-content">
? ? ? ? <ul>
? ? ? ? ? ? <li><a href="#">聯(lián)系我們</a></li>
? ? ? ? ? ? <li><a href="#" >加入收藏</a></li>
? ? ? ? ? ? <li><a href="#">設(shè)為首頁</a></li>
? ? ? ? </ul>
? ? </div>
</div>
<div class="wrap">
<div class="logo">
? ? <div class="logo-left">
? ? ? ? <img src="../../慕課練習(xí)/企業(yè)網(wǎng)站實踐(源代碼)/images/logo.jpg" alt="慕課網(wǎng)" />
? ? ? ? </div>
? ? ? ? <div class="logo-right">
? ? ? ? <img src="../../慕課練習(xí)/企業(yè)網(wǎng)站實踐(源代碼)/images/tel.jpg" alt="服務(wù)熱線" />24小時服務(wù)熱線:<span class="tel">123-456-7890</span>
<div class="nav">
? ? <div class="nav-left">
? ? ? ? <div class="nav-mid">
? ? ? ? <div class="nav-mid-left">
? ? ? ? ? ? ? ? <li><a href="#">首頁</a></li>
? ? ? ? ? ? ? ? ? ? <li><a href="list.html">關(guān)于慕課</a></li>
? ? ? ? ? ? ? ? ? ? <li><a href="list.html">新聞動態(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 class="nav-right">
? ? <div class="ad" id="picBox">
? ? <div class="loading"><img src="../../慕課練習(xí)/企業(yè)網(wǎng)站實踐(源代碼)/images/loading.gif" alt="圖片加載中" /></div>
? ? <div class="pic">
? ? ? ? ? ? ? ? <li><img src="../../慕課練習(xí)/企業(yè)網(wǎng)站實踐(源代碼)/images/ad2.jpg" /></li>
? ? ? ? ? ? ? ? <li><img src="../../慕課練習(xí)/企業(yè)網(wǎng)站實踐(源代碼)/images/ad3.jpg" /></li>
? ? ? ? ? ? ? ? <li><img src="../../慕課練習(xí)/企業(yè)網(wǎng)站實踐(源代碼)/images/ad4.jpg" /></li>
? ? <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 class="pic-news">
? ? ? ? ? ? <img src="../../慕課練習(xí)/企業(yè)網(wǎng)站實踐(源代碼)/images/news.jpg" /><h2><a href="news.html">520 慕女神喊你來表白!</a></h2>
? ? ? ? ? ? ? ? <p>活動時間:5月20日—5月25日<br />獲獎公布時間:5月26日<br /><a href="news.html">Learn More>></a></p>
? ? ? ? ? ? <div class="news-list">
? ? ? ? ? ? ? ? <li><span>2014-06-01</span><a href="news.html">【慕客訪談 用戶篇】 “有為屌絲在路上”</a></li>
? ? ? ? ? ? ? ? <li><span>2014-06-01</span><a href="news.html">【有獎活動】給父親的三行書信</a></li>
? ? ? ? ? ? ? ? <li><span>2014-05-30</span><a href="news.html">《程序猿,請曬出你的童年》活動獲獎公告</a></li>
? ? ? ? ? ? ? ? <li><span>2014-05-28</span><a href="news.html">【慕客訪談】 破繭成蝶--美女程序員的蛻變史</a></li>
? ? ? ? <div class="course">hljhlhjl</div>
? ? ? ? <div class="sidebar">uhljhljl</div>
</body>
</html>
最好把代碼 弄上來 我看看
慕粉3245911 提問者
舉報
本課程重點介紹HTML/CSS實現(xiàn)常見企業(yè)網(wǎng)站布局的方法
2 回答chrome下日期為什么錯行?
1 回答為什么日期放在標題左邊
1 回答新聞中心那的文字和日期怎么對齊呀
3 回答新聞列表日期
3 回答日期錯位的時候,放在前面,為什么在后面顯示?
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2016-12-27
連個截圖都不給嗎。。截取對應(yīng)區(qū)域的代碼。其他人也好比較嘛
還有這個DIV里的包裹順序是這樣的。你是不是復(fù)制了其他小伙伴留言里的代碼片段了?
<div class="news-list">
? ? ? ? ? ? <ul>
? ? ? ? ? ? ? ? <li><a href="#"></a><span></span></li>
? ? ? ? ? ? </ul>
?</div>
2016-05-19
<!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>無標題文檔</title>
<script src="../my focus/js/myfocus-2.0.1.min.js" type="text/javascript"></script>
<script src="../my focus/js/mf-pattern/mF_YSlider.js" type="text/javascript"></script>
<link href="../my focus/js/mf-pattern/mF_YSlider.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
myFocus.set({
id:'picBox'}
)
</script>
<style type="text/css">
*{
margin:0;
padding:0;
font-size:12px;
}
body{
background-color:#F5F5F5;
}
.top{
width:100%;
height:27px;
background:url(../../%E6%85%95%E8%AF%BE%E7%BB%83%E4%B9%A0/%E4%BC%81%E4%B8%9A%E7%BD%91%E7%AB%99%E5%AE%9E%E8%B7%B5%EF%BC%88%E6%BA%90%E4%BB%A3%E7%A0%81%EF%BC%89/images/top_bg.jpg)repeat-x;
}
.top-content{
width:1000px;
margin:0 auto;
}
.top-content li{
list-style-image:url(../../%E6%85%95%E8%AF%BE%E7%BB%83%E4%B9%A0/%E4%BC%81%E4%B8%9A%E7%BD%91%E7%AB%99%E5%AE%9E%E8%B7%B5%EF%BC%88%E6%BA%90%E4%BB%A3%E7%A0%81%EF%BC%89/images/li_bg.gif);
width:70px;
float:right;
line-height:27px;
}
.wrap{
width:1000px;
margin:0 auto;
}
.logo{
height:80px;
background:white;
}
.logo-left{
width:200px;
float:left;
}
.logo-right{
width:300px;
height:28px;
margin-top:30px;
float:right;
color:#8E8E8E;
}
.logo-right img{
vertical-align:middle;
margin-right:10px;
}
span{
font-family:"Microsoft YaHei UI";
font-size:16px;
color:red;
}
.nav{
height:40px;
}
.nav-left{
width:10px;
background:url(../../%E6%85%95%E8%AF%BE%E7%BB%83%E4%B9%A0/%E4%BC%81%E4%B8%9A%E7%BD%91%E7%AB%99%E5%AE%9E%E8%B7%B5%EF%BC%88%E6%BA%90%E4%BB%A3%E7%A0%81%EF%BC%89/images/nav_left.jpg) no-repeat;
}
.nav-mid{
width:980px;
background:url(../../%E6%85%95%E8%AF%BE%E7%BB%83%E4%B9%A0/%E4%BC%81%E4%B8%9A%E7%BD%91%E7%AB%99%E5%AE%9E%E8%B7%B5%EF%BC%88%E6%BA%90%E4%BB%A3%E7%A0%81%EF%BC%89/images/nav_bg.jpg) repeat-x;
}
.nav-right{
width:10px;
background:url(../../%E6%85%95%E8%AF%BE%E7%BB%83%E4%B9%A0/%E4%BC%81%E4%B8%9A%E7%BD%91%E7%AB%99%E5%AE%9E%E8%B7%B5%EF%BC%88%E6%BA%90%E4%BB%A3%E7%A0%81%EF%BC%89/images/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:none;
width:100px;
text-align:;
line-height:40px;
}
.nav-mid-left a:link,.nav-mid-left a:visited{
text-decoration:none;
color:#FFF;
font-size:16px;
font-family:"Microsoft YaHei UI";
}
.nav-mid-left a:hover,.nav-mid-left a:active{
text-decoration:none;
color:#FF0;
font-size:16px;
font-family:"Microsoft YaHei UI";
}
.search-text{
width:190px;
height:25px;
margin-top:5px;
background:url(../../%E6%85%95%E8%AF%BE%E7%BB%83%E4%B9%A0/%E4%BC%81%E4%B8%9A%E7%BD%91%E7%AB%99%E5%AE%9E%E8%B7%B5%EF%BC%88%E6%BA%90%E4%BB%A3%E7%A0%81%EF%BC%89/images/search.jpg) no-repeat right center;
padding-right:25px;
background-color:#FFF;
border:1px solid #FFF;
}
.ad{
height:310px;
overflow:hidden;
}
.main{
height:250px;
background:#FFF;
margin-top:5px;
}
.news{
width:340px;
border:1px solid #E8E8E8;
}
.course{
width:410px;
border:1px solid #E8E8E8;
margin:0 7px;
}
.sidebar{
width:230px;
}
.news,.course,.sidebar{
height:250px;
float:left;
}
.title{
height:35px;
border-bottom:1px solid #E8E8E8;
}
.title-left{
width:70%;
float:left;
font-family:"Microsoft YaHei UI";
font-size:14px;
line-height:35px;
font-weight:bold;
color:#786F66;
padding-left:20px;
}
.title-right{
width:20%;
float:right;
line-height:35px;
}
.title-right a{
text-decoration:none;
color:#999999;
}
.pic-news{
height:80px;
margin-top:10px;
line-height:22px;
}
.pic-news img{
float:left;
margin:0 5px;
}
.pic-news a{
color:#C00;
text-decoration:none;
font-family:"Microsoft YaHei UI";
}
.news-list{
margin-top:20px;
}
.news-list li{
list-style-type:none;
background:url(../../%E6%85%95%E8%AF%BE%E7%BB%83%E4%B9%A0/%E4%BC%81%E4%B8%9A%E7%BD%91%E7%AB%99%E5%AE%9E%E8%B7%B5%EF%BC%88%E6%BA%90%E4%BB%A3%E7%A0%81%EF%BC%89/images/list.jpg)no-repeat;
padding-left:10px;
margin:8px;
border-bottom:1px dotted #CCC;
}
.news-list a:link,.news-list a:visited{
color:#000;
text-decoration:none;
}
.news-list a:hover,.news-list a:active{
text-decoration:none;
color:#F00;
}
.news-list span{
color:#999;
float:right;
}
</style>
</head>
<body>
<div class="top">
<div class="top-content">
? ? ? ? <ul>
? ? ? ? ? ? <li><a href="#">聯(lián)系我們</a></li>
? ? ? ? ? ? <li><a href="#" >加入收藏</a></li>
? ? ? ? ? ? <li><a href="#">設(shè)為首頁</a></li>
? ? ? ? </ul>
? ? </div>
</div>
<div class="wrap">
<div class="logo">
? ? <div class="logo-left">
? ? ? ? <img src="../../慕課練習(xí)/企業(yè)網(wǎng)站實踐(源代碼)/images/logo.jpg" alt="慕課網(wǎng)" />
? ? ? ? </div>
? ? ? ? <div class="logo-right">
? ? ? ? <img src="../../慕課練習(xí)/企業(yè)網(wǎng)站實踐(源代碼)/images/tel.jpg" alt="服務(wù)熱線" />24小時服務(wù)熱線:<span class="tel">123-456-7890</span>
? ? ? ? </div>
? ? </div>
<div class="nav">
? ? <div class="nav-left">
? ? ? ? </div>
? ? ? ? <div class="nav-mid">
? ? ? ? <div class="nav-mid-left">
? ? ? ? ? ? <ul>
? ? ? ? ? ? ? ? <li><a href="#">首頁</a></li>
? ? ? ? ? ? ? ? ? ? <li><a href="list.html">關(guān)于慕課</a></li>
? ? ? ? ? ? ? ? ? ? <li><a href="list.html">新聞動態(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>
? ? ? ? <div class="nav-right">
? ? ? ? </div>
? ? </div>
? ? <div class="ad" id="picBox">
? ? <div class="loading"><img src="../../慕課練習(xí)/企業(yè)網(wǎng)站實踐(源代碼)/images/loading.gif" alt="圖片加載中" /></div>
? ? <div class="pic">
? ? ? ? ? ? <ul>
? ? ? ? ? ? ? ? <li><img src="../../慕課練習(xí)/企業(yè)網(wǎng)站實踐(源代碼)/images/ad2.jpg" /></li>
? ? ? ? ? ? ? ? <li><img src="../../慕課練習(xí)/企業(yè)網(wǎng)站實踐(源代碼)/images/ad3.jpg" /></li>
? ? ? ? ? ? ? ? <li><img src="../../慕課練習(xí)/企業(yè)網(wǎng)站實踐(源代碼)/images/ad4.jpg" /></li>
? ? ? ? ? ? </ul>
? ? ? ? </div>
? ? </div>
? ? <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="../../慕課練習(xí)/企業(yè)網(wǎng)站實踐(源代碼)/images/news.jpg" /><h2><a href="news.html">520 慕女神喊你來表白!</a></h2>
? ? ? ? ? ? ? ? <p>活動時間:5月20日—5月25日<br />獲獎公布時間:5月26日<br /><a href="news.html">Learn More>></a></p>
? ? ? ? ? ? </div>
? ? ? ? ? ? <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">【有獎活動】給父親的三行書信</a></li>
? ? ? ? ? ? ? ? <li><span>2014-05-30</span><a href="news.html">《程序猿,請曬出你的童年》活動獲獎公告</a></li>
? ? ? ? ? ? ? ? <li><span>2014-05-28</span><a href="news.html">【慕客訪談】 破繭成蝶--美女程序員的蛻變史</a></li>
? ? ? ? ? ? </ul>
? ? ? ? ? ? </div>
? ? ? ? </div>
? ? ? ? <div class="course">hljhlhjl</div>
? ? ? ? <div class="sidebar">uhljhljl</div>
? ? </div>
</div>
</div>
</body>
</html>
2016-05-19
最好把代碼 弄上來 我看看