課程
/前端開發(fā)
/HTML/CSS
/企業(yè)網(wǎng)站綜合布局實戰(zhàn)
我想問問同學們,為什么從來沒改過上下,但是上下會差很多呢?已經(jīng)用background方式檢查過是topList和ul之間差很多。(源代碼見評論區(qū)第一條)
2018-08-08
源自:企業(yè)網(wǎng)站綜合布局實戰(zhàn) 3-14
正在回答
ul給的有padding值
志遠呀 提問者
ul{
? ? list-style-type:none;?
? ? padding:0px 5px 5px 5px;
? ? font-size:12px;
}
這樣寫就沒問題了
我的也是這問題啊
<style type="text/css">.topList{width:300px;height:180px;border:1px solid #E8E8E8;margin:0 auto;}ul{list-style-type:none;padding:5px;font-size:12px;}em{width:20px;height:16px;font-style:normal;font-weight:bold;text-align:center;display:block;float:left;}.top em{color:white;background:url("http://img1.sycdn.imooc.com//53cf0fa20001d3dc00200032.jpg");background-position:16px 0;}.top_others em{color:#333;background:url("http://img1.sycdn.imooc.com//53cf0fa20001d3dc00200032.jpg");background-position:0 16px;}a:visited,a:link{color:#090909;text-decoration:none;}a:hover,a:active{color:white;background:#BE3948;text-decoration:none;padding:4px 2px;}</style>
【其中top_others是4、5、6三個li的屬性?!?/p>
舉報
本課程重點介紹HTML/CSS實現(xiàn)常見企業(yè)網(wǎng)站布局的方法
1 回答li間距問題
1 回答元素間距問題
2 回答導航欄li間距的問題
2 回答列表間距離
1 回答關(guān)于position的問題
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學習伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2018-08-13
ul給的有padding值
2018-11-22
ul{
? ? list-style-type:none;?
? ? padding:0px 5px 5px 5px;
? ? font-size:12px;
}
這樣寫就沒問題了
2018-08-10
我的也是這問題啊
2018-08-08
<style type="text/css">
.topList{
width:300px;
height:180px;
border:1px solid #E8E8E8;
margin:0 auto;
}
ul{
list-style-type:none;
padding:5px;
font-size:12px;
}
em{
width:20px;
height:16px;
font-style:normal;
font-weight:bold;
text-align:center;
display:block;
float:left;
}
.top em{
color:white;
background:url("http://img1.sycdn.imooc.com//53cf0fa20001d3dc00200032.jpg");
background-position:16px 0;
}
.top_others em{
color:#333;
background:url("http://img1.sycdn.imooc.com//53cf0fa20001d3dc00200032.jpg");
background-position:0 16px;
}
a:visited,a:link{
color:#090909;
text-decoration:none;
}
a:hover,a:active{
color:white;
background:#BE3948;
text-decoration:none;
padding:4px 2px;
}
</style>
【其中top_others是4、5、6三個li的屬性?!?/p>