October 18th, 2001, 01:03 PM
CSS not applied in DIV tags for NS
My CSS stylesheet is not taking effect within a DIV tag itself or if enclosed within a DIV tag, when viewed in Netscape 4.7.
<div id="layerID" class="some_class_name" style="position: absolute; blah: blah">
...some html here...
some html and then <font class="some_class_name">blah</font>
In both cases, the codes work fine in IE and NS6. The CSs stylesheet works fine in Netscape 4.7 if applied elsewhere in the document.
Can someone please tell me if there's a work around for this problem? (Netscape ought to be banned from the Internet!! Arghh...)
October 18th, 2001, 01:04 PM
There should be a ' ; ' after the last 'blah' in Example 1.
October 18th, 2001, 07:43 PM
Other than not applying CSS to a <font> tag (sort of defeats the purpose of CSS) try taking out underscores - if any - in your CSS id/class selectors. This kills NS4.x CSS - incorrectly, of course.
October 18th, 2001, 10:58 PM
There are no underscores in the class names and I'm actually not using any <font> tags.
Example 2 should have been:
<a href="url" class="classname">some text</a>
Using CSS within these div tags will save me a lot of work (which is what CSS is for) as they are part of my menu system. Any other work arounds?
I've even tried to use the parameters directly in the div body but it doesn't work either. e.g.
<a href="url" font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 10px; color: #CCCC00; text-decoration: none; margin-left: 5px;>some text</a>
<a href="url"><font font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 10px; color: #CCCC00; text-decoration: none; margin-left: 5px;>some text</font></a>
Is it simply not possible for such parameters to be applied within DIV tags??
Last edited by teddy; October 18th, 2001 at 11:06 PM.
October 18th, 2001, 11:56 PM
The various style attributes are strictly CSS - you have to package them in the HTML style="" attribute to apply them:
<a href="url" style="font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 10px; color: #CCCC00; text-decoration: none; margin-left: 5px;">some text</a>
Inline style is, to say the least, buggy in Navigator; class and id selectors are more reliable. Layers complicate things. If you could post the exact code - within reason - the problem would probably be familiar to someone.
Last edited by adios; October 19th, 2001 at 03:04 AM.
October 19th, 2001, 12:13 PM
I'm actually redesigning my faculty's website and am completely new to web development. You can take a look at what I've done, which is pretty much done as time is running short, at www.eelab.usyd.edu.au/~thian_ck/index.php
You'll notice that the menu system is fine on IE and NS6 but not other versions of Netscape.
Please help... if I can't fix it, I'll probably just let it be... Hate Netscape!!!
October 19th, 2001, 03:20 PM
a lotta code....
no time now, but a hint: you've got a layer inside a layer, and the CSS isn't being applied to the <a>s in the nested layer. You might want to try putting the rules directly inline (in the <a> tags) to force it to be rendered. If that doesn't help, I've had occasion to wrap <span>s around links to apply CSS. Best bet is always two style sheets (at least) - one for NS4, one for the non-crippled clients, imported separately with scripted <link> tags.
hang in there....
October 20th, 2001, 03:27 AM
I'm not too familiar with <span>s, inline, and dual stylesheets. Care to elaborate Adios? Thanks mate... really appreciate your help...
October 20th, 2001, 03:51 PM
October 21st, 2001, 03:58 AM
What are the main differences between a CSS for NS and for IE anyway? I know now how to have two or more seperate stylesheets for different browsers, but how different should the codes be?
Sorry to be such a pain... : ( And thanks for your patience.
October 21st, 2001, 05:18 PM
Sometimes you need to experiment, adding style rules until Netscape breaks...tons of fun.
I'd extract a small section of the menu, with just the container layers and one link, and experiment on that, trying inline styles if necessary, and adding rules one at a time, trying not to use obscenities any more than necessary.
October 21st, 2001, 07:29 PM
Very helpful stuff Adios. Thanks! Will try them out when I get time...