Home > Back-end >  SET background-image to a div in css
SET background-image to a div in css

Time:03-31

Whats wrong with following code, why is background image not showing:

HTML

<div > E  </div>

CSS

.logo
{
    height: 100%;
    width: 100%;
    background-image: url("/banner.svg");
}

No rocket science, by using Brackets editor, simply trying to add background-image to a div. Image file is in the same folder as .html and .css file.

CodePudding user response:

i assume your image-link is wrong. You could try to colorize the background to see if its really image related:

background-image: linear-gradient(red, yellow, blue);

CodePudding user response:

I think your image path maybe wrong

You better try this

  • Related