Have border wrap around text

后端 未结 4 805
说谎
说谎 2021-01-01 12:53

Suppose I have a div with some text in it

Title&

4条回答
  •  余生分开走
    2021-01-01 13:14

    This is because h1 is a block element, so it will extend across the line (or the width you give).

    You can make the border go only around the text by setting display:inline on the h1

    Example: http://jsfiddle.net/jonathon/XGRwy/1/

提交回复
热议问题