Welcome to Dream.In.Code
Become an Expert!

Join 149,531 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,517 people online right now. Registration is fast and FREE... Join Now!




CSS: Force height to expand

 
Reply to this topicStart new topic

CSS: Force height to expand

girasquid
30 May, 2007 - 12:48 PM
Post #1

Barbarbar
Group Icon

Joined: 3 Oct, 2006
Posts: 1,294



Thanked: 18 times
Dream Kudos: 725
My Contributions
Hello, all.

I am working on a design which can be seen here.

I need the left and right columns to expand, height-wise, until they are all the same height. Does anyone know how I could get all three columns to expand to the same height, which is defined by the longest column?

Thanks,
Girasquid
User is offlineProfile CardPM
+Quote Post

Oaty
RE: CSS: Force Height To Expand
30 May, 2007 - 07:45 PM
Post #2

New D.I.C Head
*

Joined: 10 May, 2007
Posts: 28


My Contributions
Looking at the design here are my first thoughts:
The right and center coulms have the same background color, so you could enclose them in a parent div, set the bg color and float one column against the other as you prefer, probably like so:
CODE

<div id="wrapper" style="background-color:silver;float:left;">
    <div id="blocks" style="float:left;">
        <div>
    <h1>Latest Forum Posts:</h1>
                ....
        </div>
       <div class='block'>
    <p>Would you like to buy a hamburger?</p>
       </div>
       <div class='block'>
            <p>Perhaps a vowel?</p>
       </div>
     </div> <!-- end Blocks (right col)-->
     <div id="content">
         <p>    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Phasellus in mauris a ipsum placerat pretium. Phasellus pellentesque neque tempus neque convallis congue. Ut venenatis placerat mauris. Etiam nec dolor non justo placerat condimentum. Sed eu elit ut nunc blandit hendrerit. Sed in dolor. Donec dolor turpis, hendrerit a, pretium sit amet, laoreet sit amet, arcu. Duis pharetra ante vel nisi. Proin tellus tortor, porttitor ut, consectetuer eu, venenatis ac, nibh. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris nunc.</p>...
     </div>
</div><!-- end wrapper (right wrapper col)-->

<div id="ads">
Ads will float to the left and make the page bg color the same dark gray as this col and the footer, define wrappers bg color as the lighter one.
</div>

User is offlineProfile CardPM
+Quote Post

girasquid
RE: CSS: Force Height To Expand
31 May, 2007 - 07:41 PM
Post #3

Barbarbar
Group Icon

Joined: 3 Oct, 2006
Posts: 1,294



Thanked: 18 times
Dream Kudos: 725
My Contributions
While that will make it so that the blocks OR content divs can affect the footer, it won't force them to expand height-wise if the ads div happens to shift the footer down. Is there a way to do that?
User is offlineProfile CardPM
+Quote Post

Arbitrator
RE: CSS: Force Height To Expand
1 Jun, 2007 - 08:28 AM
Post #4

D.I.C Regular
Group Icon

Joined: 26 Jan, 2005
Posts: 492



Thanked: 1 times
My Contributions
QUOTE(girasquid @ 31 May, 2007 - 10:41 PM) *
While that will make it so that the blocks OR content divs can affect the footer, it won't force them to expand height-wise if the ads div happens to shift the footer down. Is there a way to do that?
Faking the equal‐height column effect (faux columns) is the usual technique. Make sure that your layout is contained within three container elements.
  • Assign the background color or image for the center column to the outermost container element.
  • Assign to one of the two inner container elements a vertically‐repeating background image positioned to the left. This will serve as the background of the left column.
  • Ditto on the last instruction, except that you should apply it to the right side of the last container element.

And, yes, this requires that you either find some appropriate images or create them yourself. If you want the background color of the left or right columns to be a solid color, then you would create a background image one pixel tall with the width equal to the width of the respective column.

If all three columns have a fixed width, you can simplify the process even further by applying one vertically‐repeating background to a single container element. This image would represent all three columns.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 08:58PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month