你可以看看我的html和css代碼嗎?我認爲我的橫幅看起來很棒,並且我會在其他橫幅的模板中使用它。只是想確保我的代碼使用「最佳實踐」。讓我知道你是否會改變任何事情。是我的HTML和CSS橫幅的最佳做法?
這裏是我的jsfiddle:http://jsfiddle.net/huskydawgs/tKn9f/100/
<div class="box-promo-row">
<h3>
Top 10 Wi-Fi Routers</h3>
<p>
A Wi-Fi router is at the center of most people's home networks, but not every router is a good one. It's been a while since we last looked at the best Wi-Fi routers on the market, this week we want to take a fresh look and build a better top five list.</p>
</div>
#wrapper-industry,#wrapper-landing {
width: 916px;
margin: 0 auto 50px auto;
padding: 0;
}
#wrapper-landing .box-promo-row p {
color: #616161;
font-size: 1.2em;
margin: 0;
padding: 0;
font-family: Arial,sans-serif;
}
.box-promo-row {
position:relative;
width:873px;
margin: 0;
padding: 30px 20px 20px 20px;
border-left: 1px solid #e2e3e4;
border-right: 1px solid #e2e3e4;
border-bottom: 1px solid #e2e3e4;
background-color: #e2e3e4;
}
.box-promo-row:before {
position: absolute;
content: " ";
width: 100%;
height: 10px;
background: #f66511;
left: -1px;
top: 0;
z-index: 20px;
border: 1px solid #f66511;
}
.box-promo-row h3 {
font-family:Arial;
font-size:1.3em;
color:#2251a4;
margin:0 0 2px 0;
}
我會讓確定我選擇的元素存在 – Cilan
這很好。但爲什麼使用僞元素來完成這個簡單的工作?我想這是你的[問題](http://stackoverflow.com/questions/22234269/how-to-i--get-orange-bar-on-the-top-of-my-banner-instead-of-on -the-pag/22234417#22234417)對不對?我確實建議你可以使用border-top來達到相同的結果。那有什麼問題嗎? –
如果你沒有得到你想要的反饋,請嘗試[CodeReview](http://codereview.stackexchange.com/);這可能是一個更好的地方,因爲你沒有這個代碼的問題。 – admdrew