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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:55:27+00:00 2026-06-14T07:55:27+00:00

I have a absolute position div that I set on the below of another

  • 0

I have a absolute position div that I set on the below of another div. When I maximize or minimize browser press ctrl +/- then my absolute position div don’t stay his original position. Please can someone point out what I may be doing wrong here? Many thanks. Here is my code:

<html>
    <head>
        <title>Test Page</title>
        <style type="text/css">
            body
            {
                margin: 0px;
                padding: 0px;
            }
            #header
            {
                width: 980px;
                height:80px;
                background: #006666;
                margin: 0 auto;
            }

            #content
            {
                color: white;
                padding-top: 30px;
                margin-left: 200px;
            }

            #menu
            {
                position: absolute;
                top:50px;
                left:222px;
                width: 100px;
                height: 20px;
                background: red;
            }                
    </style>
    </head>
    <body>
        <div id="header">
            <div id="content">Uttara.hr</div>
            <div id="menu"></div>
        </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-14T07:55:28+00:00Added an answer on June 14, 2026 at 7:55 am

    I guess what you need is the red div below your text, so you need to give position: relative; to the parent div so that absolute positioned div doesn’t flow out in the wild

    Demo

    (Note: you can now adjust the div the way you want)

    CSS

    #header {
        width: 980px;
        height:80px;
        background: #006666;
        margin: 0 auto;
        position: relative; <---------Here
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a div that is position: absolute and it contains items that get
I know that we can have the absolute position of a div even if
I have a div which I have set to absolute position and z-index above
i have a container div which is position:relative and the squares are position:absolute because
I have a Div layer like this ... <style type=text/css> <!-- #newImg { position:absolute;
I have a <div> element with position: absolute and z-index something big. I would
I have something like this currently: <div class = className style = position: absolute;
I have following HTML: <div class=olympics style=display: block; position: absolute; left: 250px; top: px;>
I have this JSF page: <div id=settingsdiv style=width:350px; height:400px; position:absolute; background-color:r; top:20px; left:1px> <h:form>
I have 2 divs A & B. div A has a position absolute to

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.