亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

為什么.top-content li的樣式無法起作用,但是把.top-content去掉后又可以,但是只用li又會跟后面導航欄里的li有沖突?

有.top_contentde 的時候,css沒有效果:

https://img1.sycdn.imooc.com//5be989db0001a83218950254.jpg

*{
????margin:0;
????padding:0;
????font-size:12px;
}
body{
????background-color:?#f5f5f5;
}
.top{
????width:100%;
????height:27px;
????background:url(../img/top_bg.jpg)?repeat-x;
}
.top_content{
????width:1000px;
????margin:0?auto;
}
.top_content?li{
????list-style-image:?url(../img/li_bg.png);
????float:right;
????width:70px;
????line-height:?27px;
}
.top_content?a:link,.top_content?a:visited{
????color:#fff;
????text-decoration:?none;
}
.top_content?a:hover,.top_content?a:active{
????color:#900;
????text-decoration:?none;
}

沒有.top_contentde 的時候,css有效果:

https://img1.sycdn.imooc.com//5be989b90001d3e119200196.jpg

*{
????margin:0;
????padding:0;
????font-size:12px;
}
body{
????background-color:?#f5f5f5;
}
.top{
????width:100%;
????height:27px;
????background:url(../img/top_bg.jpg)?repeat-x;
}
.top_content{
????width:1000px;
????margin:0?auto;
}
li?{
????list-style-image:?url(../img/li_bg.png);
????float:right;
????width:70px;
????line-height:?27px;
}
a:link,a:visited{
????color:#fff;
????text-decoration:?none;
}
a:hover,a:active{
????color:#900;
????text-decoration:?none;
}


正在回答

1 回答

是否是你的類名錯誤,我看你問題介紹上用的是.top-content li,但是樣式中用的又是.top_content li。

1 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

為什么.top-content li的樣式無法起作用,但是把.top-content去掉后又可以,但是只用li又會跟后面導航欄里的li有沖突?

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號