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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:30:32+00:00 2026-06-15T05:30:32+00:00

I´m trying to find css a sulution for this. I have a list menu

  • 0

I´m trying to find css a sulution for this. I have a list menu at the top of my page, below this is a div with content. the content div should always have 100% of the remaining viewport hight. the browser scrollbars should be hidden, the content div should have scrollbars. no problems until here. for this i gave the content div position:absolute and a top value.

My problem know is, if the the user resizes the browser the menu brakes to a new line, and the menu overlaps the content this because the content has a fixes “top” value.

One solution would be to read the height of the menu div on browser resize and then set the position of the content div. But I like to avoid js. My question is, can I do this with css only.

Please find an example below.

Cheers,

Tony

<!DOCTYPE html>
<html lang="en">
<head class="html5">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test</title>

<style>
html, body {
    overflow: hidden;
    margin: 0;
    padding: 0;
}
#nav{
    border:1px solid black;
    overflow: auto;
    height: auto !important;
    height: 50px;
    min-height: 50px;
    }

#nav ul li{
    list-style-type: none;
    float:left;
    margin: 0 40px 0 0;
}   

#content{
    overflow:scroll;
    height:100%;
    top:50px;
    position: absolute;

}

#content p{height:1024px;border:1px solid red;margin:0;}

</style>

</head>
<body>

  <div id="nav">
    <ul>
     <li><a href="#">Menu Item</a></li>
      <li><a href="#">Menu Item</a></li>
       <li><a href="#">Menu Item</a></li>
        <li><a href="#">Menu Item</a></li>
         <li><a href="#">Menu Item</a></li>
          <li><a href="#">Menu Item</a></li>
           <li><a href="#">Menu Item</a></li>
     </ul>
   </div>


  <div id="content">
    <p class="article">here goes the content</p>
  </div>

</body>
</html>
  • 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-15T05:30:33+00:00Added an answer on June 15, 2026 at 5:30 am

    Inserts divs nav and content inside one div, container:

    <div id="container">
       <div id="nav">
          <ul>
             <li><a href="#">Menu Item</a></li>
             <li><a href="#">Menu Item</a></li>
             <li><a href="#">Menu Item</a></li>
             <li><a href="#">Menu Item</a></li>
             <li><a href="#">Menu Item</a></li>
             <li><a href="#">Menu Item</a></li>
             <li><a href="#">Menu Item</a></li>
          </ul>
       </div>
       <div id="content">
           <p class="article">here goes the content</p>
       </div>
    </div>`
    

    In your CSS:

    #container {
       width: 1024px;
       margin: 0 auto;
    }
    #nav {
       float: left;
       width: 100%;
       height: 250px;
    }
    #content{
       float: left;
       width: 100%;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a menu structure that looks like this: HTML: <li> <a href=#page> <b>Recover
I have been trying to make jquery datepicker plugin work on a content page
I'm trying to find a CSS selector that can help me distinguish between the
Trying to find an example that has css rollover using sprites & sliding door
Hi I am trying to find all js & css files in one find
I've search through about 10 pages, can't find this question here. I'm trying to
Anybody encounter this kind of problem with CSS before? I have a header that's
I searched around and couldn't find a solution to this problem. I am trying
Is it possible to animate CSS pseudo-classes? Say I have: #foo:after { content: '';
I'm trying to find a string in CSS that's been converted to an array.

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.