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 problems

Status
Not open for further replies.

jdhanley

Programmer
Oct 27, 2000
11
CA
Further to my previous post, I've narrowed down a bit what the Netscape
problem is with my layers.

It seems it doesn't like me creating two classes of styles. I never had
the problem before because I only had one class. I tried taking out one
of my classes and the class that didn't work worked fine.

Anyway, in my <DIV id=&quot;layerwhoare&quot; class=&quot;MAIN&quot;> I keep getting the
error &quot;document.layerwhoare has no properties&quot; when I try to reference
it in code

ex:
function hideLayers(){
if (document.all){
document.all(&quot;layerwhoare&quot;).style.visibility = &quot;hidden&quot;;
document.all(&quot;layerwhatdo&quot;).style.visibility = &quot;hidden&quot;;
document.all(&quot;layerwhyare&quot;).style.visibility = &quot;hidden&quot;;
document.all(&quot;layerwhatabout&quot;).style.visibility = &quot;hidden&quot;;
}
else{
document.layerwhoare.visibility = &quot;hide&quot;;
document.layerwhatdo.visibility = &quot;hide&quot;;
document.layerwhyare.visibility = &quot;hide&quot;;
document.layerwhatabout.visibility = &quot;hide&quot;;
}
}

works great in IE but not in Netscape.

Here is my style block:

<STYLE TYPE=&quot;text/css&quot;>
.MAIN{
position: absolute;
visibility: hidden;
top: 270px;
left: 180px;
}
.TEST{
position: absolute;
visibility: hidden;
top: 112px;
left: 120px;
}
</STYLE>

Like I said when I take .TEST out, .MAIN works fine. You can see what
it's doing at:
I also tried using #TEST and #MAIN, but it didn't recognize that at all.

Anyone have any suggestions as to why it's not working right?

Thanks muchly! Take care and God bless! :)

John Hanley
 
Ok, so it appears I have it working, but I'm not sure why it is the way it
is.

I have two CSS classes, one is called .MAIN, the other is .TEST.

I had listed all my <DIV> blocks at the very end of my code, just before
</BODY>. One <DIV> block used CLASS=&quot;TEST&quot;. All the other <DIV> blocks
used CLASS=&quot;MAIN&quot;. It didn't want to recognize the segments with
CLASS=&quot;MAIN&quot;.

I then put all the <DIV> blocks with CLASS=&quot;MAIN&quot; at the beginning of my
code just under <BODY>, and now it works. So my code looks like this:
<BODY>
<DIV ID=&quot;layerwhoare&quot; CLASS=&quot;MAIN&quot;>
</DIV>
body of document goes here.
<DIV ID=&quot;layer1&quot; CLASS=&quot;TEST&quot;>
</DIV>
</BODY>

Can anyone explain why it would only work for me this way in Netscape?

Thanks muchly! Take care and God bless!

John Hanley

 
Incidentally, is it true that Netscape 6 doesn't support layers at all? I'm trying to teach myself based on the premise that I can do all I need to using CSS & Dhtml.

Greg.
 
From what I've heard (I don't know for a fact), Netscape 6 did away with the <LAYER> tag and that's why I am using <DIV> with CSS positioning.

I have heard that Netscape 6 is moving to near compliency with W3C standards and therefor is scrapping all the propietary tags such as <LAYER> and is basing Netscape 6 on a beta of Mozilla.

I like universal standards, they are good things (and makes it a whole lot easier to program) :)
 
Netscape 6 has been officially released. The <layer> tag is indeed no longer supported.

nick bulka

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top