Empty div (with style: height) will not display

前端 未结 7 1208
独厮守ぢ
独厮守ぢ 2020-12-29 21:06

Incredibly simple piece of HTML - but not displaying how I would expect.

I\'m trying to create an empty div that displays as whitespace on the top of the p

7条回答
  •  梦谈多话
    2020-12-29 21:30

    For who looking for a white space (not exactly an empty div) you can add an empty span so the div is no more considered as empty one.

    Avoid using   because the default font-size can make the div higher than you want.

    div{
        height:200px;
        background:#ff8800;
    }

提交回复
热议问题