The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Layers within tables?
mcadmin
post Mar 27 2007, 11:05 AM
Post #1





Group: Members
Posts: 1
Joined: 27-March 07
Member No.: 2,346



I have some layers that I need because I'm using them in conjunction with a show/hide function. However, I only know how to create layers in "position:absolute". Every time I alter this latter part, it takes away the functionality of the layer. Rather than have the layers in a fixed position on the overall page, I want to have them always appear with in a table. Can anyone help me on this?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Mar 27 2007, 12:14 PM
Post #2


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 15,567
Joined: 9-August 06
Member No.: 6



I tell you only if you promise to get rid of he table. happy.gif

An absolutely positioned box doesn't need to be positioned relative the browser window. It's positioned relative its "containing block". The containing block for an absolutely positioned box is its closest ancestor with a position other than static.


If we have this HTML
HTML
<div id="outer">
<div id="inner"></div>
</div>


with this CSS
CODE
#outer    { margin-top: 200px;
            width: 400px; height: 400px;
            background: yellow }
#inner    { width: 50px; height: 50px;
            background: red;
            position: absolute; top: 0; left: 0 }


you'd expect the red square to be in the top left corner of the page and there's where it is. Now add the below line to the CSS and look again.
CODE
#outer    { position: relative }


http://www.w3.org/TR/CSS2/visudet.html#con...g-block-details


--------------------
"Never go to excess, but let moderation be your guide."
- Cicero

IPB Image
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 25th October 2014 - 07:38 AM