Background images in CSS

Hi

I am going through the book Build your own web site The right way using HTML and CSS and I have got to page 218

#navigation {
width: 180px;
height: 484px;
background: #7da5d8 url(backgrounds/nav-bg.jpg) no-repeat;
}

No matter what I do I can’t get the background to come up, I have a folder(background) with the backgrounds required for this part of the page in with the other files.

Help I am stuck at this part and I am bashing my head on the table.

K

Without seeing more of your (x)html code it is little had to tell. I assume you have an ID called “navigation” in the markup and a relative folder called “backgrounds” as with the CSS.

Although you wrote you had a folder called ‘background’, “[ …] I have a folder(background)…” , which is it; with or without the [s]?

Most likely you have made a small typo somewhere or misspelt the folder name – I don’t have the book so don’t know what it is supposed to be asking for.

You might want to add the " or ’ characters around the URL within the brackets, it could be that :slight_smile:

Hi
i use it to make background picture in one of my sites and that works.
hope you can use it. (pic is the name of a directory with a piture file with name franskhotdog.gif)

body {background-image:url(pic/franskhotdog.gif);
background-repeat:no-repeat;background-position:center;background-attachment:fixed;
}

You have to have

background: url(‘images/logo.jpg’) no-repeat;

with the ’ ’ for the path

Thanks everyone for all the help.
I have tried the " in the bracket area and also '. But it still doesn’t work.

Am I suppose to have a code in XHTML some where?

I’ve never had issues not incorporating " or ’ in the value’s URL…

I’ve got to believe that it’s either a path issue or a filename issue.

You should have a main folder with the HTML file in it. That folder should also have a “backgrounds” folder (no quotes). The nav-bg.jpg file should be in that folder. Are you sure you’ve not named the folder “background” (no ending s) or something similar? Are you sure you haven’t named the background graphic nav[COLOR="Red"][B]_[/B][/COLOR]bg.jpg or something else along those lines?

Katrina,

I have worked thru that section of the Build Your Site the Right Way - if you would like to you can send me a private message with your CSS page and your HTML code page as attachments and I will gladly look them over - been thru the head banging stage with that section myself.

Jeannie