Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7030703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:42:24+00:00 2026-05-28T00:42:24+00:00

I have a very basic site with a left nav bar and a larger

  • 0

I have a very basic site with a left nav bar and a larger content area on the right. They each have different backgrounds.

I want both the content and navbar to be the same height and to maintain their backgrounds. I wasn’t sure how to do this, so I put them both in a div and set its background to that of the navigation bar. When the content expands, it pushes the containing div and shows the correct background on the left:

http://jsfiddle.net/8Ngey/3/embedded/result/

When the navigation is bigger than the content, however, the background is wrong:

http://jsfiddle.net/8Ngey/2/embedded/result/

What’s the correct way to accomplish what I’m trying to do? Also, on a side note, why does the containing div have a height of 0px even when the divs inside of it have height unless I set the containing div to float left?

edit:

To clarify, I want:

  • Page as long as content
  • Navigation bar as long as page
  • Content as long as page
  • Content and navigation maintain background colors
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:42:25+00:00Added an answer on May 28, 2026 at 12:42 am

    Ah, you’ve discovered the near-impossibility of equal-height columns in CSS. There are a few hackish solutions out there, but the simplest? Faux columns.

    Simply make a 1000px wide, 1px tall image, and repeat it vertically on the background div. Make the first 100px blue, and the next 900px green. No one will know the difference!

    #background { background: url(file.png) repeat-y; }
    

    More techniques (that are generally more trouble than they’re worth).


    To answer your second question: floated elements will not add height to the parent (by default). To resolve this, simply set overflow: hidden or overflow: auto on the wrapper div (example):

    #wrapper { background:black; overflow:hidden; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very basic ASP.NET web site. It has a single page (TestPage.aspx)
I've been setting up a very basic Wordpress site. All of the pages have
I have a very basic site that works fine on its own but when
On my site I have a very basic setup: an 'a href' tag that
I have a french and a english site up, very basic. I created my
I have a site up and the search feature was very basic and always
I currently have a guest book on my site. It is very basic. Recently
I have some very basic semaphore code that works great on Linux, but cannot
I have a very basic doubt regarding the method that gets executed when app
I have a very basic knowledge of the web programming, and I couldn't figure

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.