課程
/前端開發
/HTML/CSS
/企業網站綜合布局實戰
為什么我這里只有顯示出一個灰色的圖片,藍色的圖片沒有顯示?
2015-12-26
源自:企業網站綜合布局實戰 3-14
正在回答
.top_em 什么鬼? ?改成 ?.top em 就好了
<!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=gb2312"?/>
<title>3.10新聞中心制作評測題</title>
<style?type="text/css">
?
/*在此定義相關CSS樣式*/
.toplist{
?????????width:300px;
?????????height:180px;
?????????border:1px?solid?#E8E8E8;
?????????margin:0?auto
????????}
ul{
????list-style-type:none;
????padding:5px;
????font-size:13px;
????
}
em{
????width:20px;
????height:16px;
????color:#333;
????display:blcok;
????background:url("http://img1.sycdn.imooc.com//53cf0fa20001d3dc00200032.jpg");
????background-position:0?16px;
????text-align:center;
????float:left;
.top em{
?????????background:url("?http://img1.sycdn.imooc.com//53cf0fa20001d3dc00200032.jpg");
?????????background-position:16px?0;
???????}
.a:link,.a:visited{
????????????????????underline:none;
????????????????????color:#000;
????????????????}
.a:hover,.a:active{
????????????????????color:#F00;
????????????????????}
</style>
</head>
<body>
<div?class="topList">
<ul>
<li?class="top"><em>01</em>
<p><a?href="http://www.xianlaiwan.cn/"?>【慕客訪談用戶篇】“有為屌絲”在路上</a></p>
</li>
<li?class="top"><em>02</em>
<p><a?href="http://www.xianlaiwan.cn/">【有獎活動】給父親的三行書信</a></p>
<li?class="top"><em>03</em>
<p><a?href="http://www.xianlaiwan.cn/">《程序猿,請曬出你的童年》活動獲獎公告</a></p>
<li><em>04</em>
<p><a?href="http://www.xianlaiwan.cn/">【慕課訪談】破繭成蝶——美女程序員的蛻變史</a></p>
<li><em>05</em>
<p><a?href="http://www.xianlaiwan.cn/">【獲獎公告】追“球”巔峰,爭當“預言帝”</a></p>
<li><em>06</em>
<p><a?href="http://www.xianlaiwan.cn/">【問卷調查】慕課網用戶學習情況大調查</a></p>
</ul>
</div>
</body>
你把.top em寫成.top_em了,改過來你試試
display:blcok;寫錯啦
background-position的值最好用百分比
你看這里的代碼
<!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=gb2312"?/> <title>3.10新聞中心制作評測題</title> <style?type="text/css"> /*在此定義相關CSS樣式*/ .toplist{ ?????????width:300px; ?????????height:180px; ?????????border:1px?solid?#E8E8E8; ?????????margin:0?auto ????????} ul{ ????list-style-type:none; ????padding:5px; ????font-size:13px; ??? } em{ ????width:20px; ????height:16px; ????color:#333; ????display:blcok; ????background:url("http://img1.sycdn.imooc.com//53cf0fa20001d3dc00200032.jpg"); ????background-position:0?16px; ????text-align:center; ????float:left; } .top_em{ ?????????background:url("?http://img1.sycdn.imooc.com//53cf0fa20001d3dc00200032.jpg"); ?????????background-position:16px?0; ???????} .a:link,.a:visited{ ????????????????????underline:none; ????????????????????color:#000; ????????????????} .a:hover,.a:active{ ????????????????????color:#F00; ????????????????????} </style> </head> <body> <div?class="topList"> <ul> <li?class="top"><em>01</em> <p><a?href="http://www.xianlaiwan.cn/"?>【慕客訪談用戶篇】“有為屌絲”在路上</a></p> </li> <li?class="top"><em>02</em> <p><a?href="http://www.xianlaiwan.cn/">【有獎活動】給父親的三行書信</a></p> </li> <li?class="top"><em>03</em> <p><a?href="http://www.xianlaiwan.cn/">《程序猿,請曬出你的童年》活動獲獎公告</a></p> </li> <li><em>04</em> <p><a?href="http://www.xianlaiwan.cn/">【慕課訪談】破繭成蝶——美女程序員的蛻變史</a></p> </li> <li><em>05</em> <p><a?href="http://www.xianlaiwan.cn/">【獲獎公告】追“球”巔峰,爭當“預言帝”</a></p> </li> <li><em>06</em> <p><a?href="http://www.xianlaiwan.cn/">【問卷調查】慕課網用戶學習情況大調查</a></p> </li> </ul> </div> </body>
舉報
本課程重點介紹HTML/CSS實現常見企業網站布局的方法
2 回答為什么只顯示em背景只顯示藍色
1 回答輪播圖下面的灰色和黑色的那個不顯示
3 回答為什么我的顏色顯示不對?還有上一節圖片輪播一直沒顯示,我是按照視頻來敲得啊
1 回答輪播圖只會顯示第一張圖片,沒有切換效果
5 回答圖片顯示不出來
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2016-02-16
.top_em 什么鬼? ?改成 ?.top em 就好了
2016-02-15
<!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=gb2312"?/>
<title>3.10新聞中心制作評測題</title>
<style?type="text/css">
?
/*在此定義相關CSS樣式*/
.toplist{
?????????width:300px;
?????????height:180px;
?????????border:1px?solid?#E8E8E8;
?????????margin:0?auto
????????}
ul{
????list-style-type:none;
????padding:5px;
????font-size:13px;
????
}
em{
????width:20px;
????height:16px;
????color:#333;
????display:blcok;
????background:url("http://img1.sycdn.imooc.com//53cf0fa20001d3dc00200032.jpg");
????background-position:0?16px;
????text-align:center;
????float:left;
}
.top em{
?????????background:url("?http://img1.sycdn.imooc.com//53cf0fa20001d3dc00200032.jpg");
?????????background-position:16px?0;
???????}
.a:link,.a:visited{
????????????????????underline:none;
????????????????????color:#000;
????????????????}
.a:hover,.a:active{
????????????????????color:#F00;
????????????????????}
?
</style>
</head>
?
<body>
<div?class="topList">
<ul>
<li?class="top"><em>01</em>
<p><a?href="http://www.xianlaiwan.cn/"?>【慕客訪談用戶篇】“有為屌絲”在路上</a></p>
</li>
<li?class="top"><em>02</em>
<p><a?href="http://www.xianlaiwan.cn/">【有獎活動】給父親的三行書信</a></p>
</li>
<li?class="top"><em>03</em>
<p><a?href="http://www.xianlaiwan.cn/">《程序猿,請曬出你的童年》活動獲獎公告</a></p>
</li>
<li><em>04</em>
<p><a?href="http://www.xianlaiwan.cn/">【慕課訪談】破繭成蝶——美女程序員的蛻變史</a></p>
</li>
<li><em>05</em>
<p><a?href="http://www.xianlaiwan.cn/">【獲獎公告】追“球”巔峰,爭當“預言帝”</a></p>
</li>
<li><em>06</em>
<p><a?href="http://www.xianlaiwan.cn/">【問卷調查】慕課網用戶學習情況大調查</a></p>
</li>
</ul>
</div>
</body>
2016-01-29
你把.top em寫成.top_em了,改過來你試試
2016-01-22
display:blcok;寫錯啦
background-position的值最好用百分比
2015-12-29
你看這里的代碼