PDA

View Full Version : Netscape Layer Boundry Question


rsci
09-03-2002, 04:43 PM
While working with some cross-browser layers I came across an interesting "feature". In Netscape Navigator (v 4.73) the following code doesn't behave like I expect it to.

<html>
<head><title>Test</title>
<style type="text/css">
#menu1 {position: absolute; top: 100; left: 50; width: 100; height: 200; layer-background-color: pink;}
#menu2 {position: absolute; top: 100; left: 250; width:100; height: 200; layer-background-color: pink;}
</style>
</head>
<body>
<layer id="menu1" onmouseover="alert(this.id)">text <br> text<br> text</layer>
<layer id="menu2" onmouseover="alert(this.id)">text <br> text<br> text</layer>
</body>
</html>

If the user mouseovers the space between the displayed layers, the menu2 id pops up.
Also of curiousity is that if I insert a <br> after the first layer, the second layer is pushed down. Isn't it true that an absolute positioned layer does not move?!

Thanks!

brothercake
09-03-2002, 05:07 PM
You can't really use CSS with layers like that - the layer model uses html attributes in the layer tag

like this


<html>
<head><title>Test</title>
</head>
<body>
<layer id="menu1" width=100 height=200 left=50 top=100 bgcolor="pink" onmouseover="alert(this.id)">text <br> text<br> text</layer>
<layer id="menu2" width=100 height=200 left=250 top=100 bgcolor="pink" onmouseover="alert(this.id)">text <br> text<br> text</layer>
</body>
</html>