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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:18:41+00:00 2026-06-16T15:18:41+00:00

Possible Duplicate: z-index not working with fixed positioning I am creating a app that

  • 0

Possible Duplicate:
z-index not working with fixed positioning

I am creating a app that has a fixed header and footer and a fixed left sidebar. Everything is okay except that z-index property is not working. I have set z-index of the header and footer as 1000 and that of the main div as 1. So the header and the footer should be stacked over the .main div. But the result is not the same.

<!DOCTYPE html>
<html>
  <head>
    <title>Sample Title</title>
    <link rel="stylesheet" type="text/css" href="style.css" />
  </head>
  <body>
    <div class="header fixed-top">
      <div class="header-inner">
        <ul class="nav">
          <li>
            <a href="#">Link 1</a>
          </li>
          <li>
            <a href="#">Link 2</a>
          </li>
          <li>
            <a href="#">Link 3</a>
          </li>
        </ul>
      </div>
    </div>
    <div class="sidebar-left-fixed">This is the left sidebar. This should remain fixed.</div>
    <div class="main">And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br />And here comes the content division.
    <br /></div>
    <div class="footer fixed-bottom">
      <div class="footer-inner">footer</div>
    </div>
  </body>
</html>

And this css:

a{
color: #777;
text-decoration: none;
text-shadow: 0 1px 0 white;
}
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 20px;
color: #333;padding:0;
margin:0;
}
ul{
margin:0;padding:0;
position:relative;
list-style-type:none;
}
li{float:left}
.nav > li > a{padding: 10px 15px 10px;}
.fixed-top{
position:fixed;
top:0;right: 0;
left: 0;
z-index:1000;
}
.fixed-bottom{
position: fixed;
right: 0;
left: 0;
margin-bottom: 0;bottom: 0;
z-index:1000;
}
.header-inner{
border-bottom:solid 1px #eee;
min-height: 40px;
z-index:1000;
position:relative;
}
.footer-inner{
border-top:solid 1px #eee;
min-height: 80px;
position:relative;
z-index:1000;
}

.sidebar-left-fixed{
position:fixed;
left:0;
width:250px;
border-right:solid 1px #eee;
height:100%;
top:40px;
}
.main{
margin-top:40px;
margin-left:250px;
margin-right:0;
min-height:600px;
border-right:solid 1px #eee;
border-bottom:solid 1px #eee;
padding:5px;
z-index:1;
position:relative;
}

Note: If there is some other good way to get this design, it is welcomed.

  • 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-16T15:18:42+00:00Added an answer on June 16, 2026 at 3:18 pm

    you are not given any background color for header, footer and sidebar section. otherwise it is working just fine.

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

Sidebar

Related Questions

Possible Duplicate: global variables in php not working as expected I have a php
Possible Duplicate: Difference of create Index by using include column or not using Edit:
Possible Duplicate: HTML5 input type file's multiple attribute not working in IE? i can
Possible Duplicate: PHP session seemingly not working I'm currently coding my own CMS for
Possible Duplicate: Css z-index problem Is there away that I can get the border
Possible Duplicate: PHP: “Notice: Undefined variable” and “Notice: Undefined index” This code shows warnings
Possible Duplicate: PHP: Notice: Undefined variable and Notice: Undefined index I am just learning
Possible Duplicate: how to remove index.php from url in codeigniter ? I want to
Possible Duplicate: PHP: Notice: Undefined variable and Notice: Undefined index I know its basic
Possible Duplicate: Flex RegExp to Java RegExp I don't know why is it not

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.