Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Old 01-23-2009, 12:45 AM Sidebar Height
stevej's Avatar
Professional Multitasker

Posts: 996
Location: Not positive
Trades: 0
Okay guys, I have a small problem. Actually, It will probably be a big problem if I can't get it sorted out soon.

Here is my problem: I have a main area floated to the right, with no height, and I have a sidebar floated to the left, with no height. Both of which are in a centered container, with no height. Since the sidebar has significantly less content that the main section, it does not expand to be larger like the main section - therefore causing them to be different heights. And that is my problem. I need both to the same height, no matter how much content is in the main area. I don't know of any code that will solve this for me, so I'm gonna need you guys help me come up with a solution.

Thanks!
- Steve
stevej is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-23-2009, 03:45 AM Re: Sidebar Height
Insensus's Avatar
Ultra Talker

Posts: 487
Name: Mark Stegeman
Location: Netherlands, Europe
Trades: 0
overflow: auto; on the container to make it stretch to it's content.
height: 100%; on the sidebar and also on the main content.
Just a suggestion, not sure it'll work. :P
__________________
<?php ($helpfull>0)?$talkupation++ : '';?>
Insensus is offline
Reply With Quote
View Public Profile
 
Old 01-23-2009, 05:24 AM Re: Sidebar Height
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
<self promo>
http://www.candsdesign.co.uk/article...eight-columns/


added -
One of these days I will rewrite it NOT to need fixed name elements
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?

Last edited by chrishirst; 01-23-2009 at 05:25 AM..
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-23-2009, 11:21 AM Re: Sidebar Height
stevej's Avatar
Professional Multitasker

Posts: 996
Location: Not positive
Trades: 0
Wow, thanks Chris. I knew I could do that with JavaScript, but... if there was a way with clever coding and css that would be much better.

Quote:
Originally Posted by Insensus View Post
overflow: auto; on the container to make it stretch to it's content.
height: 100%; on the sidebar and also on the main content.
Just a suggestion, not sure it'll work. :P
Thanks for the reply Insensus. The problem is, that the main container is already stretching to it's main content. And the 100% height won't work because then it stretches down to the page, no matter how much content there is.

- Steve
stevej is offline
Reply With Quote
View Public Profile
 
Old 01-23-2009, 12:36 PM Re: Sidebar Height
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
I always use the faux columns method, which is probably what Chris just pointed out (didn't read his article).
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 01-23-2009, 01:04 PM Re: Sidebar Height
stevej's Avatar
Professional Multitasker

Posts: 996
Location: Not positive
Trades: 0
Great, thanks. I've used the 'faux columns' method before, but I sort of wanted to avoid images. But, oh well. A 1px high two-color .gif isn't that big, it it?

Thanks for the help guys!
- Steve

EDIT: Ahha! Of course. I set the background of the sidebar to be the same background of the container, and then put in overflow: auto; for the container to stretch to be as high as the content. That way, it appears that the sidebar is stretching as far as the content, while it's only the background of the container. Sweeet!

Last edited by stevej; 01-23-2009 at 01:32 PM..
stevej is offline
Reply With Quote
View Public Profile
 
Old 01-23-2009, 05:52 PM Re: Sidebar Height
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
Quote:
Originally Posted by stevej
EDIT: Ahha! Of course. I set the background of the sidebar to be the same background of the container, and then put in overflow: auto; for the container to stretch to be as high as the content. That way, it appears that the sidebar is stretching as far as the content, while it's only the background of the container. Sweeet!
But what do you do if the sidebar ends up being longer than the main content?
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 01-23-2009, 05:57 PM Re: Sidebar Height
stevej's Avatar
Professional Multitasker

Posts: 996
Location: Not positive
Trades: 0
That will generate a problem. But fortunately, that's not happening with the website I am making.

- Steve

Last edited by stevej; 01-23-2009 at 05:59 PM..
stevej is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Sidebar Height
 

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.30725 seconds with 12 queries