Jump to content

Background image not loading, not repeating


mboehler3
 Share

Recommended Posts

Hi, I am creating a simple website where the stage has rounded corners. To achieve this, I cut out a header and footer with the rounded corners, and a background that repeats. My code looks like this:

<img src="images/stage-header.gif" /><div class="stage">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse placerat nunc non sem feugiat aliquam. Etiam ut lorem risus, nec porta orci. Etiam commodo sem dui, vel lacinia enim. Maecenas metus libero, aliquet vel rhoncus ac, fringilla ut eros. Fusce eget nulla vitae magna sollicitudin rutrum. Duis mollis aliquam dictum. In tortor tellus, mollis a venenatis eu, congue non odio. Curabitur quis massa vel nisl luctus hendrerit non quis lectus. Etiam vel orci non justo consectetur cursus eu ut odio. Cras accumsan purus at urna convallis aliquet. Sed iaculis suscipit iaculis. Nam ultricies pellentesque eros, et tincidunt nibh fringilla ac. Proin sapien lorem, euismod sit amet molestie at, laoreet eget neque. Curabitur nisi mauris, rhoncus vitae volutpat vel, bibendum a felis. </div><img src="images/stage-footer.gif" />

My CSS looks like this:

html, body {border:0;padding:0;}.stage {background:url('images/stage-background.gif') repeat-y; width:1073px}

I have created a master folder on my desktop. In that folder is my index.html file, an images folder and a skins folder. In the images folder is my images, the skins folder has my CSS.I'm very confused as to why this is not loading. Any help is greatly appreciated.

Link to comment
Share on other sites

if your CSS file is in a folder of it's own, and so are the images, then by writing out

images/stage-background.gif

you are telling the CSS file to look in it's own folder for a folder called images and then for the file name. what you need to do is tell it go up one folder (so it's now in the root/master folder), and then go to images. to do that, you add ../ before the file path.

../images/stage-background.gif

Link to comment
Share on other sites

if your CSS file is in a folder of it's own, and so are the images, then by writing out
images/stage-background.gif

you are telling the CSS file to look in it's own folder for a folder called images and then for the file name. what you need to do is tell it go up one folder (so it's now in the root/master folder), and then go to images. to do that, you add ../ before the file path.

../images/stage-background.gif

Thanks, this worked.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...