Click to See Complete Forum and Search --> : CSS question


MkIII_Supra
06-18-2005, 08:27 PM
I have been teaching myself CSS the last couple of weeks anbd have come to a stumper for me.

I have an image that I lock to the background so I can scroll text over it,


<html>
<head>
<style type="text/css">
body
{
background-image:
url('bgdesert.jpg') -- This is the area of question!?
}
</style>
</head>
<body>
</body>

</html>


Okay that is easy enough and I have it figured out. But the problem (as I see it) is the image has to be in the same directory as the html file. I have a folder specifically for all my CSS background that I want to use but I can't seem to get it to work. is what I want possible?


<html>
<head>
<style type="text/css">
body
{
background-image:
url('CSSIMFD/bgdesert.jpg') -- This is what I am trying to do...
}
</style>
</head>
<body>
</body>

</html>


Again as always thanks for the help!

serz
06-18-2005, 09:28 PM
Would adding a ";" work?

scsa20
06-18-2005, 10:29 PM
<style type="text/css">
<!--
body,td,th {
color: #FFFFFF;
}
body {
background-image: url(images/bg.jpg);
}
-->
</style>


That's how I got mine to work, you can even go to http://www.simon-soft.com/bgtest.html and look at the source.

soulestream
06-19-2005, 04:51 PM
you need to make a relative path for it.

if the folder is in the same folder as your css files then imagefolder/pic.jpg will work as stated if not you will need to make a path to it.

example

background-image: url(../images/bg.jpg);
that will tell it to back up one folder then go forward



if that makes sense

soule

scsa20
06-19-2005, 07:49 PM
oh, yeah, forgot to mention that part