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

  • Home
  • SEARCH
  • 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 7657963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:08:19+00:00 2026-05-31T13:08:19+00:00

I want position elements to flow under each other when resizing the window, I

  • 0

I want position elements to flow under each other when resizing the window, I have a header that height increases as window get smaller.
have a submenu displayed when click on on element on the menu, the menu will appear under the main menu and it should stick to the bottom of the header when resizing the window.

I try to the problem by detecting screen size by js and change the top dynamically, but it suddenly while resizing the window, the top is different from what it should be and it becomes at the center of the window…

I make simple example here
http://jsfiddle.net/xv8hS/1/

the auto hight is not working on this version! I want the green bar to become under the items bar when resizing the window closer and larger.

  • 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-31T13:08:21+00:00Added an answer on May 31, 2026 at 1:08 pm

    This is not a positioning, but a floating issue. Use an empty <div> with clear:both in your header (demonstration):

    <div id="container">   
        <div id="header">
            <ul>
                <li>item</li>
                <li>item</li>
                <li>item</li>
                <li>item</li>
                <li>item</li>
                <li>item</li>
            </ul>
            <div class="clearfix"></div>
        </div>
        <div id="submenu"></div>
    </div>
    
    #container{
        position:relative;
        min-height:300px;
        height:auto;
    
        width:100%;
    }
    
    #header{
    
        width:100%;
        min-height:80px;
        height:auto;
        background-color:red;
        posistion:absolute;
        top:0;
        right:0;
    
    }
    #header ul{
    
        width:100%;
        min-height:20px;
        height:auto;
    }
    #header ul li{
        min-height:50px;
        height:auto;
        display:inline-block;
        float:left;
        width:200px;
    }
    #submenu{
        width:70%;
        min-height:20px;
        height:auto;
        height:5%;
        background-color:green;
        posistion:absolute;
        top:10%;
        right:0;
    
    }
    .clearfix{clear:both;}
    

    See also:

    • CSS 2.1: 9.5 Floats
    • All About Floats
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a number of rectangular elements that I want to position in a
I have two <div> elements that I want to position side by side like
I want an array of all elements that have fixed position. This is what
I have three elements stacked into each other. Now I want the innermost element
For example I want to find all elements that have computed style position: fixed;
Basically I have an IFRAME that displays a given page. I want to position
I have html and want to select interval 5 elements from 10'th position. How
In Autohotkey, I want to position my Gui window to right bottom of the
I want to get hold of the mouse position in a timeout callback. As
I want the best way to get mouse position for Form. I,m now set

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.