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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:11:49+00:00 2026-05-29T10:11:49+00:00

<html> <body> <div class=fixed-top-bar style=position:fixed></div> <div class=content style=position:static></div> </body> </html> In my browser, both

  • 0
<html>
    <body>
        <div class="fixed-top-bar" style="position:fixed"></div>
        <div class="content" style="position:static"></div>
    </body>
</html>

In my browser, both div starts from top left of the browser.

In firebug, I set both div with “display: block” so each div element should take a row of space.
Why do I see them stacked on the top left? How can I make it look normal?

  • 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-29T10:11:50+00:00Added an answer on May 29, 2026 at 10:11 am

    When applying position: fixed, the element gets pulled out of the natural flow of the page. This causes all other elements to ignore that elements position. That’s why the static div lies below the fixed div.

    The fixed div‘s position relates to the parent element which in this case is body. Since you didn’t give it any left top right bottom position data, it just behaves like top: 0; left: 0; which happens to be the exact same postion where your static div lies below.

    To resolve this, I’d simply add the same amount of padding-top to the body as the fixed div is high.

    You can read more about this here: https://developer.mozilla.org/en/CSS/position

    By the way, a div naturally behaves as if you’d give it display: block. In fact, that’s its only default styling.

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

Sidebar

Related Questions

This problem is only in IE. Consider the following HTML: <html> <body> <div style='position:absolute;left:1em;right:1em;top:1em;bottom:1em;overflow:auto;>
Here's the HTML <div class=panel id=Panel1> <fieldset style=position: absolute; top:8px; left: 136px; width: 136px;
HTML: <body> <div class=top-corner></div> <!-- absolute, top: 0 --> <div class=bottom-corner></div> <!-- absolute, bottom:
I have the following html code. <html> <body> <div style=max-width:1600px; min-width:900px; > <table> </table>
<body> <div id=header> <div class=title>SPORTS STORE</div> </div> <div id=categories> <% Html.RenderAction(Menu, Nav); %> </div>
I have the following HTML. <body> <div class=header></div> <div class=navdiv></div> <div class=mainarea> <p></p> <table>
Here is a 3x3 table: <html> <body style=overflow:hidden;> <style> div.table_div {overflow:scroll;width:378px;height:117px;position:relative;} table.TheTable {width:361px;height:100px;table-layout:fixed;border-collapse:collapse;border:1px solid
I have this code style.css .row { position: fixed; top: 0; left: 0; bottom:
The idea: I'm creating a div that will change to position:fixed once the top
how can i convert xpath like /html/body/div[3]/ul/li[1]/a[5] html > body > div[3] > ul

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.