如何使用css将文本垂直对齐到某些文本的右侧?

时间:2013-06-03 20:00:14

标签: css

如何让读取线右侧的文字与顶行垂直对齐?

查看图片,如何将红线右侧的文字与顶部文字对齐?

http://carzibit.com/carzibit.com/main/assets/Paragraph-Align.png

2 个答案:

答案 0 :(得分:0)

您可以使用CSS的填充元素。

HTML

<div class=format>Certificaiton and E-Test are not required for entry to Carbuitlz but seller must agree to an on-site mechanic inspection at seller's price</div>

CSS

    .format{
    padding-left:100px;
}

这里是JSFiddle Link

http://jsfiddle.net/ashishtyagi10/GmqLP/

答案 1 :(得分:0)

我想你有这样的事情:

<div class="note">
    <span class="label">Note:</span>
    <span class="text">Certification and E-Tests are...</span>
</div>

我使用HTML代码dldt&amp; ddReference)代表:

<dl>
    <dt>Note:</dt>
    <dd>Certificaiton and E-Test are not required for entry to Carbuitlz but seller must agree to an on-site mechanic inspection at seller's price</dd>
</dl>

几乎不应用CSS

dl dt { float:left; }

result

result

相关问题