CSS/[removed] How to draw minimal border around an inline element?

后端 未结 1 1187
春和景丽
春和景丽 2021-01-04 12:16

Consider the following HTML:

This is a potentially large paragraph of text, which may get wrapped onto several lines when displayed in

1条回答
  •  太阳男子
    2021-01-04 12:45

    Consider adding an outline, not border http://jsfiddle.net/tarabyte/z9THQ/

    span {
      outline: 2px solid black;   
    }
    

    Firefox draws outline between lines. There is a workarond: http://jsfiddle.net/z9THQ/2/

    .wrapped {
       outline: 2px solid black;
    }
    
    .wrapped span {
        border: 1px solid white;
        background-color: white;
        position: relative;
        z-index: 1000;
    }

    This is a potentially large paragraph of text, which may get wrapped onto several lines when displayed in the browser. I would like to be able to draw a minimal box round the span

    0 讨论(0)
提交回复
热议问题