CSS create padding before line-break

前端 未结 6 1461
说谎
说谎 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:18

    I had to add an extra margin-left:0; to make the two lines start at the same point.

    This can be done with pure CSS. Create a solid box-shadow to the left and right of the highlight in the same color (and use margin to correct the spacing). For your case:

    span.highlight { 
      background: #0058be;
      color: #FFF;
      box-shadow:5px 0 0 #0058be, -5px 0 0 #0058be;
      padding: 2px 0;
      margin:0 5px;
    }
    

提交回复
热议问题