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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:53:31+00:00 2026-06-04T16:53:31+00:00

My body div collapses under the left bar navigation when i begin to minimize

  • 0

My body div collapses under the left bar navigation when i begin to minimize the window.

Can somebody please advise on what i have done wrong or what more i need to do.

Much appreciated, thank you.

css snippet:

#navigation {


   float: left;
   min-width: 20%;
   margin: 0;
   margin-top: 5px;
   font-weight: normal;

}

#centerDoc {

   float: left;
   width: 80%;
   padding: 0 0 20px 0; /*top right bottom left*/
   margin-top: 0px;

}


#header{

   position: relative;  
   width:100%;
   height:96px;
   margin-left: 5px;


}



#footer {
        font-family: Trebuchet MS;
        font-size: x-small;
        padding:2px;
        margin:0px;
        background-color:#CBE3F6;
        color:#fff;
        border-bottom: 1px solid #9EC4E2;
        border-top: 1px solid #9EC4E2;
        text-align:center;

        width: 100%;
        }


 #wrapper{


   position: relative;
   margin-left: 5px;


}



#container {
   width: 100%;
   height:100%;
}

Template of a page:

<?php require_once 'includes/header.php';?>


<div id="wrapper">

    <?php require_once 'includes/nav.php'; ?>


    <div id="centerDoc">







</div>  <!--centerDoc !-->
 </div> <!-- wrapper !-->



   </div> <!--container !-->




</body>

  • 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-04T16:53:34+00:00Added an answer on June 4, 2026 at 4:53 pm

    Remove float attribute from #centerDoc, and add margin-left: 20%. to it

    Then change min-width: 20% in #navigation to width: 20% or max-width: 20%. Without this the text inside centerDoc flows under the #navigation.

    You might want to keep your measurement synchronized. You have width: 80% in #centerDoc and min-width in #navigation. It might be easier to picture the layout if you’d used plain width in both occasions and assigned the min/max-width attributes to the body of the page (so the widths of the #navigation and #centerDoc are relative to the common parent of them).


    Edit: CSS:

    #navigation {
      float: left;
      width:20%;
    }
    #centerDoc {
      width: 80%;
      margin-left:20%;
    }
    #header{
      width:100%;
      height:96px;
    }
    #container { 
      max-width: 1200px;
      min-width: 600px;
    }
    

    Removed the #wrapper. See the max-/min-width´ in the#container. The scrollbars appear into the browser when the page is less then 600 pixels wide. The page also doesn't become wider then 1200 px. This allows you to define thewidths of the#navigationand#centerDoc` as percentages.

    With the following HTML everything should work properly. (Althought I don’t know what’s inside nav.php. Hopefully nothing that clears the floating of the #navigation)

    <div id="container">
      <?php //require_once 'includes/header.php';?>
    
    <div id="navigation">
      <?php //require_once 'includes/nav.php'; ?>
      <p>Sample text. Sample text. Sample text. Sample text. Sample text.</p>
    </div>  <!--navigation !-->
    
    <div id="centerDoc">
      <p>Sample text. Sample text. Sample text. Sample text. Sample text. Sample text.</p>
    </div>  <!--centerDoc !-->
    </div> <!--container !-->
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a div directly under the body. My HTML looks like this: <body>
how can i convert xpath like /html/body/div[3]/ul/li[1]/a[5] html > body > div[3] > ul
If I have a jQuery .click() event firing for both body and a div,
My div with class name 'header-body-right' doesn't seem to be floating to the left
So I have a div in my body that's a percentage width, and inside
Given the following html: <body> <div style=float: left; background: red>Hi</div> <div style=float: left; background:
I have a very simple HTML layout where a vertical navigation bar should sit
I have the following CSS: html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td { background: transparent; border: 0; font-size: 100%; margin:
I have a Div tag that for some reason is padding the left side
Given: Url - http://www.contoso.com/search.php?q= {param} returns: -html- --body- {...} ---div id='foo'- ----div id='page1'/- ----div

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.