我想在两个跨度之间添加一些空格。边距和paddins不起作用。我怎么能这样做?
<a href="some.action>
<span style="display: block; width: 460px; height:55px">
<span style="float:left">
<img src="uploads/image.jpg" />
</span>
<span style="float:left">
<span style="color:#286c9b">name</span>
<br/> <!-- Нow make this space bigger? Margins and paddins does not work.-->
<span>other name</span>
</span>
</span>
</a>
答案 0 :(得分:1)
只需将display:block
添加到要添加边距的范围:
<span style="float:left">
<span style="color:#286c9b; display:block; margin-bottom:20px">name</span>
<br/> <!-- Нow make this space bigger? Margins and paddings don't work.-->
<span>other name</span>
</span>
答案 1 :(得分:1)
span {display:inline-block; margin:10px;}