Reply
CSS Expanding Nested boxes?
Old 07-27-2008, 06:53 PM CSS Expanding Nested boxes?
TreyeMe's Avatar
Experienced Talker

Posts: 49
Name: Mike
Location: NY
Trades: 0
some one just slap me if this is a dumb question but...

Im having such a pain with this layout Im trying to finish I am doing this for a friend and trying to keep it simple as Im not getting paid for it but simple doesn't seem to be working for me lol. This might be a little confusing and my code is very messy right now otherwise I would post it for an example. But Ill try my best to explain everything.

Basically Is there a way to expand a box with the size of a nested box.

I have a body box basically and inside is another box that will contain all the content of the page. But when I expand the "content" box it runs over the the "body" and does not expand.

Its a fixed design of a certain width but I want the height of both the boxes to run with the content as one box is smaller than the other one.

Sorry for the confusion and ask any questions you may have.

Thanks In Advance


Heres a visual and a some code of what im trying to do

Code:
[IMG]file:///C:/Users/TreyeMe/AppData/Local/Temp/moz-screenshot-4.jpg[/IMG]<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
#body {
    position:absolute;
    left:300px;
    top:100px;
    width:500px;
    height:auto;
    z-index:1;
    background-color: #000000;
}
#content {
    position:absolute;
    left:12px;
    top:12px;
    width:476px;
    height:auto;
    z-index:2;
    background-color: #FFFF00;
}
-->
</style>
</head>

<body>
<div id="body">now what
  <div id="content">
    <p>So as you can see I just cant get the black DIV to flow around and expand with the yellow DIV</p>
  </div>
</div>

</body>
</html>

Last edited by TreyeMe; 07-27-2008 at 07:13 PM.. Reason: ADDED A VISUAL
TreyeMe is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 07-27-2008, 07:09 PM Re: CSS Expanding Nested boxes?
LadynRed's Avatar
Super Moderator

Posts: 9,036
Location: Tennessee
Trades: 0
Are you using absolute positioning ?
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 07-27-2008, 07:14 PM Re: CSS Expanding Nested boxes?
TreyeMe's Avatar
Experienced Talker

Posts: 49
Name: Mike
Location: NY
Trades: 0
I edited my post to maybe make a bit more sense....Thanks for the quick response!

Refer to the example above
TreyeMe is offline
Reply With Quote
View Public Profile
 
Old 07-28-2008, 03:44 AM Re: CSS Expanding Nested boxes?
chrishirst's Avatar
Super Moderator

Posts: 26,512
Location: Blackpool. UK
Trades: 0
position #content relative to #body

absolute positioned element are taken out of the document flow, so do not have any effect on other elements (including their container)
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | Crowded Nightclub? | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-30-2008, 05:41 PM Re: CSS Expanding Nested boxes?
TreyeMe's Avatar
Experienced Talker

Posts: 49
Name: Mike
Location: NY
Trades: 0
Perfect thanks!
TreyeMe is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to CSS Expanding Nested boxes?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.09432 seconds with 13 queries