Jump to content

CSS not working externally?


Renegade605

Recommended Posts

I'm using CSS to make my navigation bars. I have a background image and I use the CSS to place a hyperlink on the page with the navigation button behind it. It was all working fine while I tested it on one page, once it was working I moved the CSS to the external stylesheet since it will be used on every page of the site. However, once the CSS is in the external file, the background pictures for the hyperlinks do not display. They are all still aligned like they should be, just with no image underneath. Is there a problem with having the background-picture property set in the external stylesheet versus the internal one?

Link to comment
Share on other sites

Check the location reference used for the images. If the html, css, and image files are all in the same 'directory' you should see the images just fine. Otherwise, you might need to adjust the file reference in the external css file.If you have trouble with it, post the css code here, and explain where the images are stored.

Link to comment
Share on other sites

Okay, thanks I got that to work. Here's one more question:Doing that means that instead of just typing "images/buttons/navigation.gif", I have to type the whole url path. But then if I ever change the website address, I'll have to change that. To avoid scratching my head when that ever happens, is there something else I can type that will automatically update to the url, example: url(SCRIPT-TO-RETRIEVE-URL/images/buttons/navigation.gif)

Link to comment
Share on other sites

Okay, thanks I got that to work. Here's one more question:Doing that means that instead of just typing "images/buttons/navigation.gif", I have to type the whole url path. But then if I ever change the website address, I'll have to change that. To avoid scratching my head when that ever happens, is there something else I can type that will automatically update to the url, example: url(SCRIPT-TO-RETRIEVE-URL/images/buttons/navigation.gif)
if the images folder is directly above the folder that contains the webpage that is supposed to be showing the images you could try putting "../in front of the image folder.
url("../images/buttons/navigation.gif")

This way it would still be relative to its location.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...