PDA

View Full Version : StyleSheets and Netscape Problem


Phunn Gye
February 22nd, 2001, 10:28 PM
Problem: When I link a stylesheet to my pages, (I'm using HTML 4.0), Netscape 4.7 doesn't pick up the background image. It seems to be getting everything else - margins, fonts, colors etc.).
This is what I have for the -BODY- style:


body {FONT-FAMILY: Verdana,Arial,sans-serif; TEXT-ALIGN: left; FONT-SIZE: 12pt; MARGIN-TOP: 10px; MARGIN-RIGHT: 5px; COLOR: #000000; MARGIN-LEFT: 5px; BACKGROUND-IMAGE: url(../cover/bckgrnd.gif)}

This is what I use on the page to get the style ( this is in between HEAD /HEAD tags, just before the TITLE) :

<LINK REL="stylesheet" HREF="styles/mainstyle.css" TYPE="text/css">

my site is set up so that all html pages are in the site folder so that:
pictures are in mydomain.pictures
styles are in mydomain.styles
misc is in mydomain.misc
and the web pages are mydomain/pagename.html

This all works in IE 5.5 and Opera 5.02.
Can anyone tell what I'm doing wrong??
Thanks


------------------
( fun guy )-- rated PG

Steven.Bentley
February 23rd, 2001, 12:35 AM
looks like all you're missing is a /

<LINK REL="stylesheet" HREF="/styles/mainstyle.css" TYPE="text/css">

------------------
Moderator: Website and Graphics Workshop

Phunn Gye
February 23rd, 2001, 02:36 AM
Nope, that didn't do it. Besides, the rest of the stylesheet is being picked up by Netscape. The fonts, margins color are all ok. Why not the body's background image? I can load the image using the -body- tag on the page and using the url cover/bckgrnd.gif , and the stylesheet loads ok in IE .
Is it a netscape thing?


------------------
( fun guy )-- rated PG

Buzz
February 23rd, 2001, 07:49 PM
well I've never used the BACKGROUND-IMAGE tag. I tend to set both a color and an image if I use a background in the style sheets.


My standard background tags look similar to this:
background: #FFFFFF url(imagepath) top left repeat-y

You might try that. It's always worked for me.
IE will see it fine as well incase you were worried about that.

Buzz
February 23rd, 2001, 07:51 PM
BTW it's not a NS thing. IE is more forgiving than NS so if it is the BACKGROUND-IMAGE it just means IE is assuming that it's the background and NS isn't sure so it doesn't display it because it doesn't understand it.

Phunn Gye
February 24th, 2001, 03:25 AM
Buzz, and Steve :
I've tried all the suggestions so far, and the best I get is a plain white background. The worst is I get whatever color I have for the background.
I tried something else, I put the style right into the -BODY_ tag on the page and it works. Now I'm wondering if NS is having a problem with finding the background image...
the image is in one folder, the stylesheet is in another folder and the page calling the stylesheet is in neither of those.
BTW - if I try to do a 'save the backgroung' from NS I get an error that NS could not find the image, no matter where I put the image ( I've tried moving it to the same folder as the stylesheet and to the same place as the web page).

Steven.Bentley
February 24th, 2001, 12:31 PM
This looks to be the suspect to me:

<font face="Verdana, Arial" size="2">
BACKGROUND-IMAGE: url(../cover/bckgrnd.gif)
</font>

there are a few ways of writing it, try:

BACKGROUND: url(../cover/bckgrnd.gif)

------------------
Moderator: Website and Graphics Workshop

Phunn Gye
February 24th, 2001, 07:21 PM
SB:
If I use that, all I get is the background color, no image at all.

Phunn Gye
February 25th, 2001, 03:58 AM
I think I've got it: http://www.cybertechhelp.com/ubb/smile.gif

-my original had the style sheet in
mydomain/styes/nameofsheet.css
and the background in
mydoamain/pictures/background.gif

seems that NS has a bit of trouble jumping back and forth between folders... the style sheet and the background have to have the same relative path, as seen by the html on the page. So.....
I put both the stylesheet and the background in the main foder
( mydomain/background.gif and mydomain/nameofsheet.css ) and it works.

Thanks for all the help. This board is great http://www.cybertechhelp.com/ubb/biggrin.gif http://www.cybertechhelp.com/ubb/biggrin.gif


------------------
( fun guy )-- rated PG

Buzz
February 25th, 2001, 04:45 AM
glad you got it worked out. that was my next guess. I keep all my images in a relative folder to the pages so style sheet url's only contain folder/img.gif. I don't trust any browser to jump back to the root directory with the ../ command.