Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS not working with Netscape 1

Status
Not open for further replies.

tterrapin

Programmer
Jan 18, 2001
12
CA
Can someone help me with this basic CSS code and Netscape? The version of Netscape that I am using is Netscape 4.7

The below code works fine with IE but will not work with Netscape. It will set the background color correctly in Netscape but nothing else. From every web site I have checked this code looks like it should work.


body
{
color: black;
font-family: "Arial";
background-color: #FFFFFF;
background-image: url(bgrnd92.jpg);

}
 
You're right, it should be working fine.

Make sure you put this in the heading of the document, between <style type=&quot;text/css&quot;> and </style> tags...

If it is on the web, posting the url would be helpful...
 
My main (calling) document which references the css is - the css file is kasaanmenu.css

I call the style sheet by the following code and it is in the heading section of the html page:

<link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;kasaanmenu.css&quot;>

What I don't understand is neither the font-family command nor the background image commands in the CSS are working in Netscape - the background color is working in Netscape???? I don't understand why one would work but not the others.

Below is the complete CSS code:

a:link
{
color: rgb(2,11,132);
}
a:visited
{
color: rgb(10,63,222);
}
a:active
{
color: rgb(10,63,222);
}
body
{
color: black;
font-family: &quot;Arial&quot;;
background-color: #FFFFFF;
background-image:url(&quot;}

table
{
table-border-color-light: rgb(11,0,22);
table-border-color-dark: rgb(11,0,22);
}
h1, h2, h3, h4, h5, h6
{
font-family: Arial, Helvetica;
}
h1
{
color: rgb(102,51,153);
}
h2
{
color: rgb(255,102,153);
}
h3
{
color: rgb(51,153,102);
}
h4
{
color: rgb(102,51,153);
}
h5
{
color: rgb(255,102,153);
}
h6
{
color: rgb(51,153,102);
}


Thanks in advance.
Terrapin
 
I tried it with the same stylesheet you're using on your page (except I changed the background image to point to your server) and it worked for me, but it was extremely slow in both IE5.5 and NN4.7...
 
Aperfectcircle:

Perhaps my call to the style sheet is in the wrong place for Netscape. I'll include the html code for my calling page. Doesn't make sense though that it worked for you and not for me - only think I can think of is that you are perhaps calling it from within your program than a different place than me.

Thanks

Terrapin

<!doctype html public &quot;-//w3c//dtd html 4.0 transitional//en&quot;>
<html>
<head>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<title>Kasaan Alaskan Malamutes</title>
<script language=&quot;JavaScript&quot;>

//function Precache(){
var i = 0

//this one takes the pic names, if the paths are different, put them
//here also otherwise add them as a string later
var picnameArr = new Array(&quot;home.gif&quot;,&quot;home4.gif&quot;,&quot;pedigree.gif&quot;,&quot;pedigree3.gif&quot;,&quot;back.gif&quot;,&quot;back3.gif&quot;,&quot;austin.jpg&quot;,&quot;pawbar.gif&quot;)

//this one takes all the heights of the images, it should be of equal
//size to the previous Array
var picheightArr = new Array(39,39,39,39,39,39,319,25)

//this one takes all the widths of the images, it should be of equal
//size to the previous Array
var picwidthArr = new Array(94,94,94,94,94,94,349,574)
//this one takes images as objects
var picobjectArr = new Array()

//loop through and build the object array

for(i = 0;i < picnameArr.length;i++){
picobjectArr = new Image(picwidthArr,picheightArr)
picobjectArr.src = picnameArr
}

for(i = 0;i < document.images.length;i++){
document.images.src = picobjectArr
}
//}
//-->
</script>
<link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;kasaanmenu.css&quot;>
</head>

&nbsp;
<center><table BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=&quot;100%&quot; >
<tr>
<td WIDTH=&quot;100%&quot;>&nbsp;
<center>
<div align=&quot;center&quot;>
<center><table BORDER=0 WIDTH=&quot;100%&quot; >
<tr>
<td VALIGN=TOP COLSPAN=&quot;3&quot; WIDTH=&quot;100%&quot;>
<p align=&quot;center&quot;><img border=&quot;0&quot; src=&quot;austinhdg.gif&quot; width=&quot;702&quot; height=&quot;52&quot;></p>
</td>
</tr>

<tr>
<td ALIGN=LEFT VALIGN=TOP WIDTH=&quot;69%&quot;>&nbsp;
<center>
<p><img SRC=&quot;Austin2.jpg&quot; BORDER=2 height=319 width=349 align=CENTER><font color=&quot;#000066&quot;></font>
<p><b>Austin</b></p>
<p>&nbsp;</center>
</td>

</tr>


<tr>
<td VALIGN=TOP COLSPAN=&quot;3&quot; WIDTH=&quot;100%&quot; align=&quot;center&quot;>
<p align=&quot;center&quot;>
<a href=&quot;index.htm&quot; onmouseover=&quot;image1.src='home4.gif';&quot; onmouseout=&quot;image1.src='home.gif';&quot;><img SRC=&quot;home.gif&quot; NAME=&quot;image1&quot; ALT=&quot;Home&quot; border=&quot;0&quot; width=&quot;94&quot; height=&quot;39&quot;></a>&nbsp;
&nbsp;<a href=&quot;javascript:history.go(-1)&quot; onmouseover=&quot;image3.src='back4.gif';&quot; onmouseout=&quot;image3.src='back.gif';&quot;><img SRC=&quot;back.gif&quot; Name=&quot;image3&quot; Alt=&quot;Back&quot; border=&quot;0&quot; width=&quot;94&quot; height=&quot;39&quot;></a>&nbsp;&nbsp;
<a href=&quot;Austinped.htm&quot; onmouseover=&quot;image2.src='pedigree4.gif';&quot; onmouseout=&quot;image2.src='pedigree.gif';&quot;><img SRC=&quot;pedigree.gif&quot; NAME=&quot;image2&quot; ALT=&quot;Pedigree&quot; border=&quot;0&quot; width=&quot;94&quot; height=&quot;39&quot;></a>
</center>
</center>

<p align=&quot;left&quot;>&nbsp;</td>
</tr>
</table>
</center>
</div>
</td>
</tr>
</table>

<!--#include virtual='bottombar.htm' -->

</html>

 
The problem is that you don't have a <body> section in your page so Netscape doesn't know where to apply the body style...
After the </head> tag add a <body> tag and then at the bottom add a </body> tag before </html> and it should work fine...
 
Thank you &quot;aperfectcircle&quot; - that was exactly it! Strange that it worked in IE (actually no it's not :). Thanks again... it always helps to have another set of eyes looking at code.

Terrapin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top