inline elment new line

HTML

<h3>
    <span class="label">This is the main label</span>
    <span class="secondary-label">secondary label</span>
</h3>

CSS

.label:after {
    content: '\A';
    white-space: pre;
}
原理:css 中,字符串中不能直接插入new line,可以借助\A 实现。参考标准:http://www.w3.org/TR/CSS2/syndata.html#strings

同时,white-space:pre;



参考:https://coderwall.com/p/zvz52g

http://stackoverflow.com/questions/4609279/css-to-line-break-before-after-a-particular-inline-block-item/4609491#4609491


你可能感兴趣的:(inline elment new line)