Previous Message
Next Message

[css-d] Netscape 6 problem

Sent by RUST Randal on 25 January 2002 10:10

Hello all,

I am new to the list (thanks to Zeldman).  I have found a little quirk in
Netscape 6.2, and I wanted to see if anyone else has experienced the
problem, or if I'm just screwing something up.


I have a Javascript that toggles the visibility of <div> elements.

	<script language="javascript">
		function showHide(id){
		if (document.getElementById(id).style.display=="none") {
		document.getElementById(id).style.display="inline"; } 
		else {
		document.getElementById(id).style.display="none"; }

Now, here is an example of a <div>:

<div id="cheese">
	<p>this is inside of the <div> element</p>

Here is the CSS for "cheese:"

#cheese {
	position: relative;
	width: 60%;
	color: black;
	background-color: gray; }

I have a link applied that looks like this:

<a href="#" onclick="showHide('cheese');">Cheese</a>

According to the CSS spec, the child elements of "cheese" should not be
displayed when the display property of "cheese" is set to "none."  However,
this only works as expected in IE 6 (Win).  In order to get it to work
correctly in NN 6, I have to do one of two things:  set the "float"
property, or set the position to "absolute."

What gives with that?

Randal Rust
Senior Consultant
Covansys, Inc.
Columbus, OH
Previous Message
Next Message