我有一系列內嵌顯示的標記框。他們可能會超過容器的寬度。在這種情況下,我想他們創造另一種「想象的」行如下:CSS溢出框
[friend][foe][enermy][love]
[hate][indifferent]
我怎樣才能達到這種效果呢?
我的設置現在以某種方式創建了非常奇怪的行爲:包含[仇恨]的框的一小部分(及其背景)實際上在第一行,而框的文本和背景出現在第二行。
[friend][foe][enermy][love][]
[hate][indifferent]
定義時,這些標籤我沒做什麼奇怪的:
.tag-label {
border-radius: 3px 3px 3px 3px;
color: #FFFFFF;
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 10.998px;
font-weight: bold;
line-height: 13px;
margin: 2px;
padding: 1px 4px 2px;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
vertical-align: middle;
white-space: nowrap;
}
這裏是HTML。要我刪除一些元素
<div id="content">
<span class="tag-label">
<a href="/searches/search_tags?search_type=Listing&tag=search">search (1)</a>
</span>
<span class="tag-label">
<a href="/searches/search_tags?search_type=Listing&tag=text">text (1)</a>
</span>
<span class="tag-label">
<a href="/searches/search_tags?search_type=Listing&tag=cool">cool (1)</a>
</span>
</div>
你可以請張貼HTML嗎? – 2012-04-02 22:54:00
HTML與CSS不匹配。請仔細檢查。 – iambriansreed 2012-04-02 23:13:34
我不喜歡使用內聯塊,因爲它在ie7-上工作起來真是太時髦了。 – iambriansreed 2012-04-02 23:17:06