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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I am having problems with CSS in Netscape

Status
Not open for further replies.

empirejoe

Programmer
Nov 12, 2002
2
US
I designed about 40 pages that use an attached css.
I have the following line in all my pages...

<link rel=stylesheet type=&quot;text/css&quot; href=&quot;..\menustyle.css&quot;>
or
<link rel=stylesheet type=&quot;text/css&quot; href=&quot;..\mainstyle.css&quot;>

The pages look great in ie6.0 but in Netscape 7.0 some things just don't look the same. I am using frames and have a left column that is a menu and on the right is the main content page. both pages use their own style sheet. I have the same infomation in both css pages for the body tag. both pages have the same syntax for the body tag in the html page. But in the main page the background color works and in the menu page the background does not work.

Also I use table borders. they work in my menu page and not on my main page.

I can post some code if anyone needs to see it to better understand my problem, but I was wondering if there are any known issue with the combination of style sheets, netscape and frames, or maybe it is something that I am missing all together.
 
From what I have seen with my sites, I have had to make a different style sheet that Netscape, Mozilla and Opera will use, especially if you are using absolute positioning.

I have set my pages up so that they will detect and then use the appropriate style sheet for the browser type and screen resolution.
 
Thank you. Can you tell me how to detect what browser is viewing a page and then send that user to the appropriate css file?

Do I just need two css files or do I need to create a second site with the minor changes needed to make it look right on Netscape?
 
The following is what I'm using in the head section of my web pages. Someone else might have a better script to use.

<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
<!-- Begin

var browser_name = navigator.appName

if (browser_name==&quot;Microsoft Internet Explorer&quot; && screen.width <= 800){
document.write('<link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;ie800.css&quot;>');
}

else if (browser_name == &quot;Netscape&quot; && screen.width >= 801){
document.write('<link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;netscape1024.css&quot;>');
}

else if (browser_name == &quot;Netscape&quot; && screen.width <= 800){
document.write('<link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;netscape800.css&quot;>');
}

else if (browser_name == &quot;Microsoft Internet Explorer&quot; && screen.width >= 801){
document.write('<link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;ie1024.css&quot;>');
}

else if (browser_name==&quot;Opera&quot; && screen.width <= 800){
document.write('<link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;netscape800.css&quot;>');
}

else if (browser_name==&quot;Opera&quot; && screen.width >= 801){
document.write('<link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;netscape1024.css&quot;>');
}

// End -->
</script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top