如何均匀排列/缩进此文本?

时间:2016-11-21 21:52:50

标签: html

Pic of Uneven text



@IBOutlet weak var PageContentLabel: UILabel!




1 个答案:

答案 0 :(得分:0)

将内容包装在div元素中并应用我在下面的.hang风格中列出的css代码。

<强> HTML

   <div class="hang">
     <img src="https://maxcdn.icons8.com/iOS7/PNG/25/Business/pricing_structure-25.png" title="Pricing Structure" width="25" style="margin-right: 8px">
    Choose ones of our packages or build your own. Choose ones of our packages or build your own. 

    <a href="pricing.html">View pricing.</a>
    </div>

<强> CSS

.hang {
    text-indent: -2.3em;
    margin-left: 3em;
}

工作示例

https://jsfiddle.net/nickcpainter/7vuh2f6k/