2012-04-16 43 views
1
<h3><img src="image.png" width="124" height="124" alt="" style="float: left;"/>This is a heading</h3> 
This is text. 
<ol> 
<li>A list Item</a> 
</li><li>Another list item</a> 
</li><li><a href="http://www.facebook.com/TVN.cl">Another list item with a link</a> 
</li> 
</ol> 

我有一個圖像,我想漂浮在一些文本內容的左側。我注意到有序和無序列表上的項目符號與浮點數一起摺疊,並且向圖像添加邊距或填充不會添加任何效果。是否有任何干淨的方式來保留列表邊距,同時保留默認數量和項目符號?CSS:避免與列表項目符號和浮動崩潰邊距

Example

回答

1

把保證金上你的OL標籤,並使其移動在朝好的方向發展

<h3><img src="image.png" width="124" height="124" alt="" style="float: left;"/>This is a heading</h3> 
This is text. 
<ol style="margin:0px 0px 0px 10px;"> 
<li>A list Item</a> 
</li><li>Another list item</a> 
</li><li><a href="http://www.facebook.com/TVN.cl">Another list item with a link</a> 
</li> 
</ol> 
1

嗨,你可以定義OL浮動屬性這樣

的CSS

ol{ 
float:left; 
} 
0

give flo在您OL或者您可以使用此CSS: -

ol { 
margin:0 0 0 10px; 
padding:0px; 
float:left; 

} 

ol li a { 
color:#000; 
text-decoration:none; 
}