MyBB Community Forums

Full Version: WAMP help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Well I designing a website template (Sort of, I dont think you can call it 'designing' xD) and I am trying to give something a background image using CSS.

Lets say I have this:

<div id="box">Box content here</div>
And for the CSS I have this:
#box {
	background: #000000 url(images/boxbg.gif) top left repeat-x;
}

For some reason it doesnt want to use that background image I called in the CSS class Sad
But, if I upload the image to Photobucket, and use that URL instead, it works fine Dodgy

Any help?
Oh and if I use inline CSS like this:
<div id="box" style="background: #000000 url(images/boxbg.gif) top left repeat-x;">Box content here</div>

It works Dodgy
CSS in a stylesheet or style tags??
Stylesheet. I havent tried it in style tags but I hate using style tags.
Me too, stylesheets are best... and this is the sort of code you're using in the <head> to include it??

<link type="text/css" rel="stylesheet" href="http://localhost/foldername/filename.css" />
Sort of, I have this:
<link rel="stylesheet" type="text/css" href="styles/style.css" />
<div id="box" style="background: #000000 url(images/boxbg.gif) repeat-x top left;">Box content here</div>

The order of the background attributes matters.

http://www.w3schools.com/css/pr_background.asp
(2010-01-15, 09:14 PM)Dennis Tsang Wrote: [ -> ]
<div id="box" style="background: #000000 url(images/boxbg.gif) repeat-x top left;">Box content here</div>

The order of the background attributes matters.

http://www.w3schools.com/css/pr_background.asp

1. I want to set the background image in the external stylesheet
2. I have always put the position before the repeat and it works perfect everytime.
Is the CSS file on another directory?

Oh, or have you checked using Web Inspector or Firebug to see what kind of issue is going on there?
My CSS is in a folder called 'styles' and it is called 'style.css' and thats what I called in the header, 'styles/style.css'. Everything BUT the background images work.
ohh so that's it. You have to put ../images/boxbg.gif
Pages: 1 2