background-image doesn't appear if
is empty?

前端 未结 8 1078
旧巷少年郎
旧巷少年郎 2020-12-07 01:11

I created a

first thing in the to draw a top line at the top of the page:


    
8条回答
  •  隐瞒了意图╮
    2020-12-07 01:49

    Give the div a height:1px. That should work. Otherwise your div is 0px high, meaning you won't see anything.

    You could also give it padding-top:1px

    Another thing you could do is to set the background-image of the line on the body in your CSS. This is assuming the line is the entire width of the body.

    See demo

提交回复
热议问题