Line break (like
) using only css

前端 未结 3 800
执笔经年
执笔经年 2020-11-27 12:45

Is it possible in pure css, that is without adding additional html tags, to make a line break like
? I want the line break after the

<

3条回答
  •  無奈伤痛
    2020-11-27 13:11

    It works like this:

    h4 {
        display:inline;
    }
    h4:after {
        content:"\a";
        white-space: pre;
    }
    

    Example: http://jsfiddle.net/Bb2d7/

    The trick comes from here: https://stackoverflow.com/a/66000/509752 (to have more explanation)

提交回复
热议问题