Reputation: 397
This syntax is incorrect?
CODE CSS:
.navbar-custom{
background:url(images/bgi/bg.png);
}
CODE HTML
<nav class="navbar navbar-custom">
//some code HTML
</nav>
I put an image to view image made way
Do you know where does this matter?
EDIT:
Upvotes: 1
Views: 50
Reputation: 943207
The syntax is correct. The URL is not.
URLs in stylesheets are relative to the stylesheet URL, not the HTML document URL.
The images
directory is a sibling to the css
directory. It isn't inside it.
background:url(../images/bgi/bg.png);
Upvotes: 4
Reputation: 1285
Is your css file in the "test" folder? The path you provide in url is relative to wherever the css file is saved.
You also have no quotes around your path, which should be there - but I'm not sure would cause the issue.
Try:
.navbar-custom{
background: url("/images/bgi/bg.png");
}
With the forward slash, you're going back to the root of the site - and then into the images folder. This would solve the problem if for example you have css in a sub-folder of test. I've also added in the quotes for completeness.
Upvotes: 5