indent wrapped text

前端 未结 3 1790
春和景丽
春和景丽 2021-02-07 04:28

So I\'m simulating a table layout with a div and a couple spans inside it. I\'d like the span on the right to indent any text that wraps. I\'ve tried a few things and can\'t ge

3条回答
  •  我寻月下人不归
    2021-02-07 04:51

    It sounds like you want a hanging indent. CSS something like this should do the trick:

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

    But since your is an inline element, the text-indent property, as well as other CSS properties pertaining to a block, is meaningless.

提交回复
热议问题