Reputation: 3437
I am trying to add a background image to a simple horizontal list and for some reason, I am unable to get it to show. This is a static HTML/CSS practice page that can be viewed @ DropBox
Here is my HTML markup
<section class="welcome-msg">
<p>Good Morning</p>
<ul>
<li>Edit Bill</li>
<li>Mark Bill as Paid</li>
<li>Bill Details</li>
<li>Help</li>
</ul>
</section>
And here is the CSS
.welcome-msg li {
display: inline;
float: left;
margin: 0 20px;
background-image: url(Image/details-icon.png);
background-repeat: no-repeat;
/*background-position:5px 0px;*/
}
And here is the screenshot of the image folder
Upvotes: 0
Views: 807
Reputation: 3711
You image folder isn't in the same folder as your CSS file.
-CSS
--style.css
-Images
--img.png
--img2.png
You therefore need to go a level up first (out of the css folder) and then into the Image
directory. This is achieved by using ../
at the beginning of the path.
Therefore your URI should be:
background-image: url(../Image/details-icon.png);
Upvotes: 2
Reputation: 1661
Please use developer console (F12) for debugging.
Problem with incorrect path.
background-image: url(../Image/details-icon.png);
Upvotes: 1