How to align an indented line in a span that wraps into multiple lines?

后端 未结 7 500
不知归路
不知归路 2021-02-04 23:34

Does anyone have an idea how to align the second line?

7条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-05 00:03

    elements are inline elements, as such layout properties such as width or margin don't work. You can fix that by either changing the to a block element (such as

    ), or by using padding instead.

    Note that making a span element a block element by adding display: block; is redundant, as a span is by definition a otherwise style-less inline element whereas div is an otherwise style-less block element. So the correct solution is to use a div instead of a block-span.

提交回复
热议问题