Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Getting layers to stay relative to a table

0 views
Skip to first unread message

The Doctor

unread,
Dec 23, 2009, 7:04:51 PM12/23/09
to
Quick question:

Trying to design a web page with 2 navigations relative to a table.

<body>
<table >

The first table is just a nav with 2 items:

<div id="Layer2" style="position:absolute; width:696px; height:27px;
z-index:2; left: 210px; top: 160 px;">

First nav contained

</div>

<div id="Layer1" style="position:absolute; width:194px; height:178px;
z-index:3; top: 176px; left: 214px;">

2nd nav contained

</div>

rest of page.

</table>

What do I need to stabilse the LAyer so that they are relative to the tables?
--
Member - Liberal International This is doc...@nl2k.ab.ca Ici doc...@nl2k.ab.ca
God, Queen and country! Never Satan President Republic! Beware AntiChrist rising!
http://twitter.com/rootnl2k http://www.myspace.com/502748630
Merry Christmas 2009 and Happy New Year 2010

Ben C

unread,
Dec 24, 2009, 3:27:24 AM12/24/09
to
On 2009-12-24, The Doctor <doc...@doctor.nl2k.ab.ca> wrote:
> Quick question:
>
> Trying to design a web page with 2 navigations relative to a table.
>
><body>
><table >
>
> The first table is just a nav with 2 items:
>
><div id="Layer2" style="position:absolute; width:696px; height:27px;
> z-index:2; left: 210px; top: 160 px;">

If the table just has a div in it like that and no tr or td then you're
off to a bad start. Browsers will do unpredictable things with broken
markup like that.

That may be the whole problem.

> First nav contained
>
></div>
>
><div id="Layer1" style="position:absolute; width:194px; height:178px;
> z-index:3; top: 176px; left: 214px;">
>
> 2nd nav contained
>
></div>
>
> rest of page.
>
></table>
>
> What do I need to stabilse the LAyer so that they are relative to the tables?

Make the table position: relative and z-index: 0. But that doesn't work
in Firefox, so in that case just put a div around the table and set that
to position: relative and z-index: 0 instead. This will have the same
effect if the table has no borders or padding.

Why do you need a table anyway?

Rob W.

unread,
Dec 24, 2009, 2:50:14 PM12/24/09
to
Ben C schreef:

> On 2009-12-24, The Doctor <doc...@doctor.nl2k.ab.ca> wrote:
>> Quick question:
>>
>> Trying to design a web page with 2 navigations relative to a table.
>>
>> <body>
>> <table >
>>
>> The first table is just a nav with 2 items:
>>
>> <div id="Layer2" style="position:absolute; width:696px; height:27px;
>> z-index:2; left: 210px; top: 160 px;">
>
> If the table just has a div in it like that and no tr or td then you're
> off to a bad start. Browsers will do unpredictable things with broken
> markup like that.
>
> That may be the whole problem.
>


Maybe the good Doctor can provide a URL
so we can check what his code really looks like.

--
Rob

The Doctor

unread,
Dec 24, 2009, 3:13:14 PM12/24/09
to
In article <4b33c602$0$22936$e4fe...@news.xs4all.nl>,

Actually I found an answer on Web.

dorayme

unread,
Dec 24, 2009, 3:24:20 PM12/24/09
to
In article <hh0i0q$1o7$1...@gallifrey.nk.ca>,
doc...@doctor.nl2k.ab.ca (The Doctor) wrote:

> Actually I found an answer on Web.

And you did not think to give it to us as xmas present? <g>

--
dorayme

Ed Mullen

unread,
Dec 24, 2009, 9:27:07 PM12/24/09
to
The Doctor wrote:
> In article<4b33c602$0$22936$e4fe...@news.xs4all.nl>,
> Rob W.<robwaai...@hotmail.com> wrote:
>> Ben C schreef:
>>> On 2009-12-24, The Doctor<doc...@doctor.nl2k.ab.ca> wrote:
>>>> Quick question:
>>>>
>>>> Trying to design a web page with 2 navigations relative to a table.
>>>>
>>>> <body>
>>>> <table>
>>>>
>>>> The first table is just a nav with 2 items:
>>>>
>>>> <div id="Layer2" style="position:absolute; width:696px; height:27px;
>>>> z-index:2; left: 210px; top: 160 px;">
>>>
>>> If the table just has a div in it like that and no tr or td then you're
>>> off to a bad start. Browsers will do unpredictable things with broken
>>> markup like that.
>>>
>>> That may be the whole problem.
>>>
>>
>>
>> Maybe the good Doctor can provide a URL
>> so we can check what his code really looks like.
>>
>> --
>> Rob
>
> Actually I found an answer on Web.

And, umm, you don't think we'd be interested in the solution?
Merry-freaking-Christmas! Thanks a lot.

Oh, well. It's ok. I'm no worse off than before. And, in the spririt
of the season: I wish you and yours a joyous one.

My Christmas present to you is to forget this minor transgression and,
if I can, answer your next cry for help here without bias.

Happy Holidays.

--
Ed Mullen
http://edmullen.net
Old age is when you still have something on the ball but you are just
too tired to bounce it.

0 new messages