CSS create padding before line-break

前端 未结 6 1431
说谎
说谎 2020-12-13 04:18

Is it possible to add padding before line-break? As in, making from this \"enter to this

6条回答
  •  南方客
    南方客 (楼主)
    2020-12-13 05:14

    You can achieve this using just box shadow, with no messy padding or margins.

    The trick is to use box-shadow's spread option, and the padding on wrapped inline elements behaves as you expect.

    .highlight {
        background: black;
        color: white;
        box-shadow: 0 0 0 5px black;
    }
    

提交回复
热议问题