Yasmika Saubhagya Yasmika Saubhagya - 2 years ago 96
CSS Question

Background image doesn't show within the <div> element - CSS/HTML

screenshot of the directory structure
I created a

element and I'm going to use below
style withing the

#girls {
background-image: url("girl.gif");

Here is my HTML
element (This element contains in

<div id="girls">
<b>Girls chat:</b> at the lounge, we're committed to providing you, our guest, with an exceptional
experience every time you visit. Whether you're just stopping by to check in on email over an elixir,
or are here for an out-of-the-ordinary dinner, you'll find our knowledgeable service staff pay attention to every
detail. If you're not fully satisfied, have a Blueberry Bliss Elixir on us.

But when I load index page, the background image (girl.gif) doesn't show up. Anyone can help me with this?

Answer Source

Try this:

#girls {
    background-image: url("../girl.gif");

I'm guessing that the css is inside that stylesheet folder, that's why you need to go up a level to access girl.gif, thus the usage of ../

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download