Adding background image to div using CSS

后端 未结 8 1758
终归单人心
终归单人心 2020-12-24 02:09

I have been trying to add background image to a div class using CSS, but I didn\'t have any success.

HTML code:

8条回答
  •  长情又很酷
    2020-12-24 02:17

    It is happening because .header-shadow is empty.

    Add height to it:

    .header-shadow{
        background-image: url('../images/header-shade.jpg');
        background-color: red;
        height: 50px;
    }
    

    Fiddle here.

提交回复
热议问题