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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:42:30+00:00 2026-05-25T01:42:30+00:00

I am trying to create a layout using a fixed header and sidebar but

  • 0

I am trying to create a layout using a fixed header and sidebar but I wan’t to make the layout in the center of the browser.. Obvisously this is a problem as fixed usually doesn’t allow this. I thought about putting a wrapper around everything and using margin: 0px auto; etc. but that didn’t work, is it possible or not?

   #header {
position: fixed;
top: 0;
left: 0;
width: 100%; 
height: 150px;
background-color: #FFF;
z-index: 100;
}


#content {
width: 1112px;
overflow: auto;
padding-top: 150px;

}


#sidebar {
position: fixed;
top: 0;
left: 0;
width: 275px;
height: 100%;
z-index: 100;

}

Had in mind something like this but it didn’t work:

body {
    margin:0px 0px; padding:0px;
    text-align:center;  
}


#wrapper {
text-align: left;
margin: 0px auto;
}

divs:

<div id="wrapper">
<div id="header"></div>
<div id="content"></div>
<div id="sidebar"></div>
</div>
  • 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-25T01:42:30+00:00Added an answer on May 25, 2026 at 1:42 am

    Try this:

    CSS:

    body {
    margin:0; 
    padding:0; 
    }
    
    
    #wrapper {
    margin: 0 auto 0 auto;
    width:1112px;
    min-height:600px;
    height:auto;
    background-color:#009900;
    }
    
    #header {
    position: fixed;
    width: 1112px; 
    height: 150px;
    background-color: #ccc;
    z-index: 100;
    }
    
    
    #content {
    position:absolute;
    top:150px;
    margin-left:275px;
    overflow: auto;
    width:837px;  /* 1112px - 275px = 837px */
    background-color:#CC9900; 
    }
    
    
    #sidebar {
    position: fixed;
    top:150px;
    width: 275px;
    height: 100%;
    min-height:200px; /* just do simulate content */
    z-index: 100;
    background-color:#96F;
    }
    

    HTML:

    <div id="wrapper">
    <div id="header">Fixed header</div>
    <div id="content">
    <p>Dummy Text</p><br /><br /><br />
    <p>Dummy Text</p><br /><br /><br />
    <p>Dummy Text</p><br /><br /><br />
    <p>Dummy Text</p><br /><br /><br />
    <p>Dummy Text</p><br /><br /><br />
    <p>Dummy Text</p><br /><br /><br />
    <p>Dummy Text</p><br /><br /><br />
    <p>Dummy Text</p><br /><br /><br />
    </div>
    <div id="sidebar">Fixed sidebar</div>
    </div>
    

    If I understand your question, I think this is a possible way to do it. Try it, and tell me so! 🙂

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

Sidebar

Related Questions

I'm trying to create a sitemap using Linq to Xml, but am getting an
Im trying to create a layout in flex using mxml, the layout contains a
I'm trying to create a scrollable layout in Android. Even using developers.android.com, though, I
I am trying to create a frameset and I am doing this using Rails.
i am trying to create a css layout using pixels and percentages. the reason
Trying to create a user account in a test. But getting a Object reference
Trying to create several layers of folders at once C:\pie\applepie\recipies\ without using several different
I'm trying to do a seemingly simple webpage layout, but I'm hitting a wall.
I am trying to create a CSS layout where the page looks like it's
I am trying to create a list template in SharePoint Feature using CAML. I

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.