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 8290459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:49:17+00:00 2026-06-08T12:49:17+00:00

I’m using two css files [for my fluid width site here][1]: one where the

  • 0

I’m using two css files [for my fluid width site here][1]: one where the left hand nav is ‘display:none’ when below a certain width.

I’m setting the right hand nav (with banners) to max-width:348px and a padding-left:20px.

The problem happens when I set the #main-content div to a percentage width: it doesn’t resize correctly and causes it to drop down below the right nav when the window’s reduced. It doesn’t really make sense so not sure how the best way to go about it is.

Within the #main-content div, there is the #left-nav and #middle divs which are floated left and I’ve specified max-widths and padding.

When the window is below a certain width I’ll remove the left nav with display:none, but until then I’d like the #main-content width to be fluid.

The left nav also needs to be a specific width to ensure the list items stay on one line.

Hope someone can help; it’s probably something simple, but just can’t make it to work..

Here’s the CSS:

.right-nav {
  padding:0 0 0 20px;
  margin:0;float:right;
  width:348px;
}
#main-content {
  border: 1px solid #e3e3e3;
  border-botom:0;
  box-shadow: 0px -1px 18px #e0e0e0;
  margin-top:-2px;
  position:relative;
  z-index:1;
  float:left;
  width:70.2%;
  background-color:#fff;
  height:100%;
  float:left;
  padding:30px 0 0;
  -webkit-border-top-right-radius: 8px;
  -moz-border-radius-topright: 8px;
  border-top-right-radius: 8px;
}
#left-nav {
  float:left;
  width:20.5%;
  padding:15px 0 5px 20px;
  background-color:#fff;
  color:#888;
  height:100%;
  margin:0;
}
#middle {
  width:72.3%;
  background-color:#fff;
  height:100%;
  float:left;
  margin:0 21px 5px;
}

error page: here

  • 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-06-08T12:49:19+00:00Added an answer on June 8, 2026 at 12:49 pm

    It’s to do with the margins on your #middle element. Your widths are percentages but your margins are absolute values.

    To give you an example, when you reduce the screen size down so #main-content is 824px wide, you end up with;

    #left-nav: 20.5% = 168.92px plus padding-left = 20px;

    #middle: 72.3% = 595.72px plus margin = 42px (21px either side)

    Total = 828px and therefore #middle has to drop down below #left-nav

    So it’s a case of either reducing the percentages, making the margins percentages or adding a new @media screen style for those smaller widths.

    *EDIT based on comments.

    It’s the same thing going on again – you’re .right-nav element has a fixed width of 348px, the #main-content has a max-width of 67% but absolute padding of 20px either side;

    So if the whole #content-wrapper has a width of 1069px you have;

    .right-nav: 348px

    #main-content = 716px; padding: 40px (20px left and 20px right).

    Total = 1104px and the #main-content drops down. It’s the mix of relative(%s) and absolute(pixels) that’s causing the issues.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am reading a book about Javascript and jQuery and using one of the
I have thousands of HTML files to process using Groovy/Java and I need to
I'm making a simple page using Google Maps API 3. My first. One marker
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have a French site that I want to parse, but am running into

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.