我有以下幾點:如何使十個<a>鏈接顯示爲五行中的兩行?
<div id='hdr_thm'>
<div>
<a style="background-color: #FFFFFF;" href="#" data-style="arctic" title="Arctic"></a>
<a style="background-color: #F2F2F2;" href="#" data-style="aristo" title="Aristo"></a>
<a style="background-color: #E6E6E6;" href="#" data-style="black-tie" title="Black Tie"></a>
<a style="background-color: #CCCCCC;" href="#" data-style="blitzer" title="Blitzer"></a>
<a style="background-color: #808080;" href="#" data-style="cobalt" title="Cobalt"></a>
</div>
<div>
<a style="background-color: #FCEE21;" href="#" data-style="flick" title="Flick"></a>
<a style="background-color: #D9E021;" href="#" data-style="hot-sneaks" title="Hot Sneaks"></a>
<a style="background-color: #8CC63F;" href="#" data-style="humanity" title="Humanity"></a>
<a style="background-color: #009245;" href="#" data-style="le-frog" title="Le Frog"></a>
<a style="background-color: #006837;" href="#" data-style="midnight" title="Midnight"></a>
</div>
... etc
</div>
#hdr_thm {
margin: 0;
position: absolute;
right: 10px;
top: 15px;
z-index: 20;
}
#hdr_thm a {
border: 1px solid #050505;
cursor: pointer;
display: block;
float: left;
height: 10px;
margin: 0;
width: 10px;
}
我想這樣做是爲了在這裏有兩行。每行有五個<a>
元素。但對我來說,問題 是我如何獲得行以環繞,使第二個五個方塊出現在第一個五個以下的 之下。
聽起來像你需要[換行符](http://www.w3schools.com/tags/tag_br.asp)! – bzlm 2012-02-17 08:59:10