課程
/前端開發(fā)
/HTML/CSS
/導(dǎo)航條菜單的制作
不是說只有在設(shè)置了絕對(duì)定位之后才能使用top嗎,為什么好多并沒有設(shè)置絕對(duì)定位的情況下也可以設(shè)置top值,而且還起作用
2016-11-10
源自:導(dǎo)航條菜單的制作 4-2
正在回答
top值,沒有起什么效果啊,把top去掉也沒有任何變化啊
<style type="text/css">
*{margin:0; padding:0; font-size:14px;}
a{color:#333;text-decoration:none}
ul{list-style:none; height:50px; border-bottom:5px solid #F60; padding-left:30px;}
ul li{float:left; margin-top:20px;}
a{display:block;height:30px;text-align:center; line-height:30px; width:120px; background-color:#ccc;}
a.on, a:hover{ color:#fff;background-color:#F60;height:40px; ? top:10px;line-height:40px;margin-top:-10px;}
</style>
有可能是繼承了父級(jí)的position屬性了吧
summer樂 提問者
舉報(bào)
水平、垂直、圓角導(dǎo)航條菜單,讓您的技術(shù)探索之路更高效
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2016-11-10
top值,沒有起什么效果啊,把top去掉也沒有任何變化啊
2016-11-10
<style type="text/css">
*{margin:0; padding:0; font-size:14px;}
a{color:#333;text-decoration:none}
ul{list-style:none; height:50px; border-bottom:5px solid #F60; padding-left:30px;}
ul li{float:left; margin-top:20px;}
a{display:block;height:30px;text-align:center; line-height:30px; width:120px; background-color:#ccc;}
a.on, a:hover{ color:#fff;background-color:#F60;height:40px; ? top:10px;line-height:40px;margin-top:-10px;}
</style>
2016-11-10
有可能是繼承了父級(jí)的position屬性了吧