跨度之间的一些空间

时间:2014-12-28 13:15:45

标签: html css

我想在两个跨度之间添加一些空格。边距和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>

2 个答案:

答案 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;}