CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 11th, 2003, 09:07 PM
zewt's Avatar
zewt zewt is offline
PHP user-in-training
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2001
Location: Sacramento Calif. USA
Posts: 677 zewt New User: is a brand new recruit and a unknown entity at this point. 
Time spent in forums: 1 Day 10 h 7 m
Reputation Power: 0
Trying to put two boxes inside a thrid box with CSS. But outside will not autosize.

Here is the code of what I am attempting:

PHP Code:
#outside_box {
    
positionrelative;
    
width100%;
    
font18px Verdanasans-serif;
    
color#777777;
    
padding0px;
    
border1px solid #999999;
    
margin-bottom5px;
    
backgroundtransparent;
    }

#inside_box_left {
    
positionabsolute;
    
width70%;
    
left:0;
    
padding0px;
    
border0px solid #999999;
    
margin0px;
    
backgroundlightgrey;
    }
#inside_box_right {
    
positionabsolute;
    
width30%;
    
right:0;
    
padding0px;
    
border0px solid #999999;
    
margin0px;
    
backgroundlightgrey;
    }



<
div id="outside_box">

    <
div id="inside_box_left">
text left box
    
</div>

    <
div id="inside_box_right">
text right box
    
</div>

</
div


The two inside boxes form correctly, but the outside box does not correctly adjust to contain the inside boxes.

I know I have read something about what I am missing here, so am hoping someone can give me a pointer.

Thanks for any help.

Reply With Quote
  #2  
Old June 11th, 2003, 09:39 PM
DrWorm's Avatar
DrWorm DrWorm is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2002
Location: Queensland, Australia
Posts: 827 DrWorm User rank is First Lieutenant (10000 - 20000 Reputation Level)DrWorm User rank is First Lieutenant (10000 - 20000 Reputation Level)DrWorm User rank is First Lieutenant (10000 - 20000 Reputation Level)DrWorm User rank is First Lieutenant (10000 - 20000 Reputation Level)DrWorm User rank is First Lieutenant (10000 - 20000 Reputation Level)DrWorm User rank is First Lieutenant (10000 - 20000 Reputation Level)DrWorm User rank is First Lieutenant (10000 - 20000 Reputation Level)DrWorm User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 5 Days 18 h 34 sec
Reputation Power: 140
I believe this page has your answer

http://www.alistapart.com/stories/practicalcss/

Reply With Quote
  #3  
Old June 11th, 2003, 09:48 PM
zewt's Avatar
zewt zewt is offline
PHP user-in-training
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2001
Location: Sacramento Calif. USA
Posts: 677 zewt New User: is a brand new recruit and a unknown entity at this point. 
Time spent in forums: 1 Day 10 h 7 m
Reputation Power: 0
Yes it may, thanks for the reference.

Reply With Quote
  #4  
Old June 12th, 2003, 01:01 PM
clam61 clam61 is offline
Senior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 151 clam61 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 36 sec
Reputation Power: 0
seems fine to me. the outside box is 100%, with the inners adding up to 100% too. what are you trying to do?

Reply With Quote
  #5  
Old June 12th, 2003, 04:35 PM
zewt's Avatar
zewt zewt is offline
PHP user-in-training
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2001
Location: Sacramento Calif. USA
Posts: 677 zewt New User: is a brand new recruit and a unknown entity at this point. 
Time spent in forums: 1 Day 10 h 7 m
Reputation Power: 0
Unhappy

Well the problem with the CSS examples given, is that they will not fill up their respective side of the outside box.

So for example, if I want to have two boxes next to each other, as you might have two table cells. And I want the left box to be some form entry description, and the right box to be the form text entry cell - If the text is long the box on the left will expand correctly(3 lines), but the background of the box on the right(1 line), will only extend to the vertical height of the 1 line.

Now if you used two table cells and not css, you could have each cells color defined, and not worry about the left cell being 3 times as high as the cell on the right, and thus affected the right cells background color.

Hope that makes sense.

Reply With Quote
  #6  
Old June 12th, 2003, 04:44 PM
clam61 clam61 is offline
Senior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 151 clam61 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 36 sec
Reputation Power: 0
Oh, ok. then set the height of the inner boxes to 100%

Reply With Quote
  #7  
Old June 12th, 2003, 08:07 PM
zewt's Avatar
zewt zewt is offline
PHP user-in-training
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2001
Location: Sacramento Calif. USA
Posts: 677 zewt New User: is a brand new recruit and a unknown entity at this point. 
Time spent in forums: 1 Day 10 h 7 m
Reputation Power: 0
Yes, tried that and still no luck, the rightside box still wants to only cover 1 line height for some reason.

here is what the CSS looks like:

PHP Code:
#inside_box_left {
    
floatleft;
    
padding-left10px;
    
width70%;
    
height100%;
    
left:0;
    
padding0px;
    
border0px solid #999999;
    
margin-left0px;
    
backgroundlightgrey;
    }
#inside_box_right {
    
floatright;
    
padding-right10px;
    
width30%;
    
height100%;
    
right:0;
    
padding0px;
    
border0px solid #999999;
    
margin-right0px;
    
background#999999;
    


Reply With Quote
  #8  
Old June 12th, 2003, 09:00 PM
clam61 clam61 is offline
Senior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 151 clam61 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 36 sec
Reputation Power: 0
oh. you must set the outer box to have a height. then it will work.

Reply With Quote
  #9  
Old June 12th, 2003, 10:48 PM
zewt's Avatar
zewt zewt is offline
PHP user-in-training
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2001
Location: Sacramento Calif. USA
Posts: 677 zewt New User: is a brand new recruit and a unknown entity at this point. 
Time spent in forums: 1 Day 10 h 7 m
Reputation Power: 0
Ahhh, that got it. Thanks


Reply With Quote
  #10  
Old June 13th, 2003, 12:04 AM
zewt's Avatar
zewt zewt is offline
PHP user-in-training
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2001
Location: Sacramento Calif. USA
Posts: 677 zewt New User: is a brand new recruit and a unknown entity at this point. 
Time spent in forums: 1 Day 10 h 7 m
Reputation Power: 0
hah.

Ok one more question.

I have a checkbox in the right-side box, is there a way to vertically align it?

I tried

vertical-align:middle;

and

vertical-align:text-middle;

but had no success.

Since it is a form object, not sure how to deal with it.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > Trying to put two boxes inside a thrid box with CSS. But outside will not autosize.

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap