第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

列表溢出問(wèn)題,以及項(xiàng)目圖片和文字不在一水平線

<!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新聞中心制作評(píng)測(cè)題</title>

<style type="text/css">


/*在此定義相關(guān)CSS樣式*/

.topList{

? ? width:300px;

? ? height:180px;

? ? border:1px solid #e8e8e8;

? ? margin:0 auto;

}


ul{

? ? list-style-type:none;

? ? padding:5px;

? ? font-size:12px;

? ? margin-top:-15px;

}

em{

? ? width:20px;

? ? height:16px;

? ? text-align:center;

? ? line-height:16px;

? ? font-style:normal;

? ? color:#333;

? ? background-image:url(http://img1.sycdn.imooc.com//53cf0fa20001d3dc00200032.jpg);

? ? background-position:bottom;

? ? display:block;

? ? float:left;

}


.top em{

? ? background-image:url(http://img1.sycdn.imooc.com//53cf0fa20001d3dc00200032.jpg);

? ? background-position:top;

? ? color:#fff;

}

a:link,a:visited{

? ? text-decoration:none;

? ? color:#888;

}

a:hover,a:active{

? ? color:#f00;

}

p{

? ? line-height:20px;

}


</style>

</head>


<body>

<div class="topList">

<ul>

<li class="top"><em>01</em>

<p><a href="http://idcbgp.cn/" >【慕客訪談?dòng)脩羝俊坝袨閷沤z”在路上</a></p>

</li>

<li class="top"><em>02</em>

<p><a href="http://idcbgp.cn/">【有獎(jiǎng)活動(dòng)】給父親的三行書信</a></p>

</li>

<li class="top"><em>03</em>

<p><a href="http://idcbgp.cn/">《程序猿,請(qǐng)曬出你的童年》活動(dòng)獲獎(jiǎng)公告</a></p>

</li>

<li><em>04</em>

<p><a href="http://idcbgp.cn/">【慕課訪談】破繭成蝶——美女程序員的蛻變史</a></p>

</li>

<li><em>05</em>

<p><a href="http://idcbgp.cn/">【獲獎(jiǎng)公告】追“球”巔峰,爭(zhēng)當(dāng)“預(yù)言帝”</a></p>

</li>

<li><em>06</em>

<p><a href="http://idcbgp.cn/">【問(wèn)卷調(diào)查】慕課網(wǎng)用戶學(xué)習(xí)情況大調(diào)查</a></p>

</li>

</ul>

</div>

</body>

56d4306a0001c7de03220195.jpg

上圖為例子


56d4306a0001c4af05000293.jpg

上圖為我寫的代碼成像。

寫完代碼后,發(fā)現(xiàn)p標(biāo)簽中的文字和左邊的項(xiàng)目符號(hào)背景圖不在一水平線上,使用line-height來(lái)保持一水平線,但是列表就溢出topList

于是,使用margin的負(fù)值。

但總覺(jué)得這樣的方法不好,求指教

正在回答

3 回答

將p設(shè)置左浮動(dòng)

0 回復(fù) 有任何疑惑可以回復(fù)我~

*{

? ? padding:0;

? ? margin:0;

? ? }

.topList{

? ? width:300px;

? ? height:180px;

? ? border:1px solid #e8e8e8;

? ? margin:5px auto;

}

ul{

? ? list-style:none;

? ? padding:5px;

}

ul li{

? ?height:30px;?

}

a{

? ? text-decoration:none;

? ? font-size:12px;

}

a:link,a:visited{

? ? color:#333;

}

a:hover,a:active{

? ? color:red;

}

em{ ??

? ? width:20px;

? ? height:16px;

? ? text-align:center;

? ? font-style:normal;

? ? color:#000;

? ? background:url(http://img.imooc.com/53cf0fa20001d3dc00200032.jpg);

? ? background-position:0 16px;

? ? float:left;

? ? line-height:16px;

? ? display:block;?

? ? font-size:12px;

}

.top em{

? ? background:url(http://img.imooc.com/53cf0fa20001d3dc00200032.jpg);

? ? background-position:16px 0;

? ? color:#fff;

}

完美的答案?。?!

0 回復(fù) 有任何疑惑可以回復(fù)我~

<!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新聞中心制作評(píng)測(cè)題</title>
<style type="text/css">

/*在此定義相關(guān)CSS樣式*/
.topList{
??? width:300px;
??? height:180px;
??? border:1px solid #E8E8E8;
}? ?
.topList ul{
??? list-style:none;
??? padding:5px;
??? font-size:12px;
}

.topList em{
??? width:20px;
??? height:16px;
??? font-style:normal;
??? color:#333;
??? background:url("http://img1.sycdn.imooc.com//53cf0fa20001d3dc00200032.jpg");
??? background-position:0 16px;
??? float:left;
??? text-align:center;
}
.topList .top em{
???? background:url("http://img1.sycdn.imooc.com//53cf0fa20001d3dc00200032.jpg");
??? background-position:16px 0;
??? color:#fff;?? ?
}
.topList a:link,.topList a:visited{
??? text-decoration:none;
??? color: #000;
}
.topList a:hover,.topList a:actiove{
??? text-decoration:none;
??? color: #f00;
}


</style>
</head>

<body>
<div class="topList">
<ul>
<li class="top"><em>01</em>
<p><a href="http://idcbgp.cn/" >【慕客訪談?dòng)脩羝俊坝袨閷沤z”在路上</a></p>
</li>
<li class="top"><em>02</em>
<p><a href="http://idcbgp.cn/">【有獎(jiǎng)活動(dòng)】給父親的三行書信</a></p>
</li>
<li class="top"><em>03</em>
<p><a href="http://idcbgp.cn/">《程序猿,請(qǐng)曬出你的童年》活動(dòng)獲獎(jiǎng)公告</a></p>
</li>
<li><em>04</em>
<p><a href="http://idcbgp.cn/">【慕課訪談】破繭成蝶——美女程序員的蛻變史</a></p>
</li>
<li><em>05</em>
<p><a href="http://idcbgp.cn/">【獲獎(jiǎng)公告】追“球”巔峰,爭(zhēng)當(dāng)“預(yù)言帝”</a></p>
</li>
<li><em>06</em>
<p><a href="http://idcbgp.cn/">【問(wèn)卷調(diào)查】慕課網(wǎng)用戶學(xué)習(xí)情況大調(diào)查</a></p>
</li>
</ul>
</div>
</body>

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

列表溢出問(wèn)題,以及項(xiàng)目圖片和文字不在一水平線

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)