css background image

M

Mark

I am creating an external css page in fp 2003. What I would like to do is
specify a certain image in my image directory that would be the default
background image for all web pages in my site. Do you manual create this in
my external css page that I have created? If so what is the code/script to
create this?

Thanks,
 
M

Murray

body { background-image:url(images/foo.jpg); }

You may also want to specify a background-repeat style or even a
background-position style.
 
J

Jon Spivey

Hi,
body{
background-image: url(Images/PageBackground.jpg);
}

Make the url relative to the stylesheet.

Jon
 
M

Mark

Okay I haven't used css much which you can probably figure out. I am not
getting the image to display as the page background. my css page will
display the color, font, text size that I have chosen but I must be
configuring the image area incorrectly. The url area - do I put in place of
the url - the url of the web site? I understand the images/name of file but
the url I'm not clear about

body { background-image:url(images/foo.jpg); }
 
D

David Berry

It means that the URL path to the image should be relative to where the page
with the stylesheet is. For example, if the page is in the root and the
image is in the images folder then it would be images/PageBackgound.jpg

If the page was deeper in the web then the path might be ../images or even
.../../images etc. If the page was in the same folder as the image then you
wouldn't need images/ you'd just put PageBackground.jpg
 
J

Jon Spivey

Hi,
If you had folders like this
/scripts
stylesheet.css
/images
YourBackground.jpg

then the css would be
body{
background-image: url(../Images/PageBackground.jpg);
}
 
M

Mark

Well I can now get it to work but in netscape or firefox the background will
not display but the font size and colors do
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

background image 1
problem with repeating css graphic 3
css web background frontpage 2003 3
Frontpage 2003 and external CSS 1
Link in CSS 1
css page problems 2
need help with CSS and DWT 1
CSS Table Question 6

Top