...

View Full Version : CSS and JS not showed in Netscape.



crristi
10-11-2004, 07:04 PM
Hi people.
I build some pages and i tested them just with IE. Now i tried with Netscape 7.0 and all my css styles are not working.

Look how i done it:
1. I create a css style page with the code:


A.menu:link {
color: #ffffff;
font-family:verdana,arial,helvetica;
font-size: 12px;
font-weight:bold;
TEXT-DECORATION: none
}
A.menu:hover {
color: #336699;
font-family:verdana,arial,helvetica;
font-size: 12px;
font-weight:bold;
TEXT-DECORATION: underline;
font-weight:bold;
font-style: normal;
line-height: normal;
font-variant: normal;
text-transform: none;
border: thin none #FFFFFF;
}
A.menu:visited {
color: #ffffff;
font-family: Verdana;
font-weight:bold;
font-size: 12px;
TEXT-DECORATION: none
}
A.menu:hover {
color: #336699;
font-family:verdana,arial,helvetica;
font-weight:bold;
font-size: 12px;
TEXT-DECORATION: underline
font-style: normal;
line-height: normal;
font-variant: normal;
text-transform: none;
border: thin none #FFFFFF;
}


i saved the file as menu.css

2. i create the menu with the links


if (document.all)
document.write(
"<div id='content' style='position: relative; width: 140px; height: 75px;'>\
\
<span class='menu'>\
<img src='../css-js/bumb.gif'/> <a href='index.htm', class='meniu_stanga'>first page</a>\
</span>\
\
<span class='menu'>\
<img src='../css-js/bumb.gif'/> <a href='arhiva_editoriale.htm' class='menu'>second page</a>\
</span>\
\
<span class='menu'>\
<img src='../css-js/bumb.gif'/> <a href='cititori.htm' class='menu'>third page</a>\
</span>\
\
</div>");


I saved it like menu.js

3. I created the web page well i add the js menu and i made a link to the css style page. But Netscape 7 is not seeing the css styles. what to do.
Here is the cod of the trial page im working on , to figure out what happening



<html>
<head>
<title>TRIAL</title>
<link href="style.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">



</script>

<body bgcolor="#999999" onLoad="settitle()">
<div id="Layer3" style="position: absolute; left: 121px; top: 238px; width: 201px; height: 19px; z-index: 3"><script language="JavaScript" src="menu.js" type="text/JavaScript"></script></div>

</html>


If somebody can tell me what to do is free to e-mail me also at crristi@tiscali.it

gohankid77
10-11-2004, 07:05 PM
Um... You could try getting rid of the "."s in front of the ":"s

crristi
10-11-2004, 07:12 PM
thanks but its still not working.
im waiting other advices guys.
Cristian

gohankid77
10-11-2004, 07:21 PM
Oops! I forgot! NS doesn't use document.all

Change "if (document.all)" to "if (document.all||document.getElementById)".

crristi
10-11-2004, 09:06 PM
i modified that line and in deed now is working. thanks you.
but i still have one more thing to ask: its not showing me the menu itemes one under the other, is like its writing a normal text from the start to the end of the row. please look in the css file i done and tell me whats wrong, or if i have to change sth else too in the js file in the way that netscape to recognise the arangement of the items.
thanks again, this time in advanced :-)

gohankid77
10-11-2004, 10:56 PM
Please post a screenshot that shows what you want. It is hard to figure out without something to use as a basic model.

crristi
10-12-2004, 06:34 PM
here we go. you have a part of the page displayed in netscape. you will not understant the words cause are in another language that english :-)

the problem is how the left part, the one with the manu is displayed.
cristian

Roy Sinclair
10-12-2004, 08:34 PM
<div id="Layer3" style="position: absolute; left: 121px; top: 238px; width: 201px; height: 19px; z-index: 3"><script language="JavaScript" src="menu.js" type="text/JavaScript"></script></div>


I suspect your specified width is simply too small to contain all the text, since you haven't specified what to do in the case of an overflow it appears Netscape has decided to honor the width request and override your height while the fact that you don't seem to be seeing this in IE means IE probably honors the height and overrides your width.

gohankid77
10-12-2004, 09:14 PM
I'm going to take a guess and say the page is in Italian. ;)

Perhaps using a list would be better?



if (document.all || document.getElementById)
document.write(
"<div id='content' style='position: relative; width: 140px; height: 75px;'>
<ul style='list-style: square outside url(\"../css-js/bumb.gif\");'>
<li><a href='index.htm', class='meniu_stanga'>first page</a></li>
<li><a href='arhiva_editoriale.htm' class='menu'>second page</a></li>
<li><a href='cititori.htm' class='menu'>third page</a></li>
</ul>
</div>");


That should work better. Note that I removed the "<span class='menu'>" parts before the <img/> tags and the "</span>" parts after the </a> tags because in your CSS that you posted, the "menu" class was for <a> tags. You already have that in your code, so there is no need for the <span> tags, unless you have something else defined for them. I also removed the <img/> tags because the 'list-style' part in the <ul> tag takes care of it. If "outside" doesn't work in 'list-style', change it to "inside". Tell us how it works.

crristi
10-13-2004, 12:16 PM
I am at work now, so i cant tell you if the codes are working or not. I will post a message latter, when i will be back home.
But i will thank you anyway :-)

also, in a way you guessed what language its about. Its a language that is based on the Roman`s Empire language. Its not italian, its romanian :P

Cristian



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum