indent wrapped text

前端 未结 3 1724
春和景丽
春和景丽 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:34

    The CSS 3 draft specifies a hanging indent. If supported by Browsers, the following should work:

    .hanging-indent
    {
      text-indent: 3em hanging each-line;
    }
    

    Unfortunately neither hanging nor each-line values are currently supported in modern browsers as the specification for CSS Text Module Level 3 is still a Draft.

    The feature is implemented with a browser specific prefix for WebKit and Chromium. For Firefox there is an open Bug you may vote on.

提交回复
热议问题