5 fixed divs, with a relative div above them

I would like to have a fixed header, a fixed left menu, a fixed right menu, and a fixed footer with scrollable content in the middle. I've done this code below, however I don't know how to place the dropdown menu above other DIVs. This is always behind everything, even with a z-index of 10.

<header>
    <div id="dropdown"></div>
</header>

<div id="menuleft"></div>
<div id="content"></div>
<div id="menuright"></div>

<footer></footer>

      

Check it out here with css: http://jsfiddle.net/hdkmvxhb/26/

+3


source to share


3 answers


Check it out use the following Css For a demo check the following: http://jsfiddle.net/nikkirs/tge195y8/19/



header{
width:100%;
    height:49px;
    position:fixed;
    background:#000;
}
.container{
    width:100%;
    position:relative;
    min-height:400px;
    padding-top: 50px
}
.left_container{
position:fixed;   
    width:30%;
    border-right:1px solid #000;
     min-height:400px;
    left:0px;
}
.middle_container{
  width:30%;  
     min-height:400px;
    float: left;
}
.right_container{
    position:fixed;
     width:30%;
     border-left:1px solid #000;
     min-height:400px;
    right:0px;
}
footer{
    position:fixed;
    height:30px;
    background:#000;
    width:100%;
}
ul {
  text-align: left;
  display: inline;
  margin: 0;
  padding: 15px 4px 17px 0;
  list-style: none;
  -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
  -moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
}
ul li {
  font: bold 12px/18px sans-serif;
  display: inline-block;
  margin-right: -4px;
  position: relative;
  padding: 15px 20px;
  background: #fff;
  cursor: pointer;

}
ul li:hover {
  background: #555;
  color: #fff;
}
ul li ul {
  padding: 0;
  position: absolute;
  top: 48px;
  left: 0;
  width: 150px;
display:none;
  display: block;
  opacity: 1;

}
ul li ul li { 
  background: #555; 
  display: block; 
  color: #fff;
  text-shadow: 0 -1px 0 #000;
}
ul li ul li:hover { background: #666; }
ul li:hover ul {
  display: block;
  opacity: 1;
  visibility: visible;
}

      

+1


source


FS FIDDLE DEMO

Html

<header>
    <div id="dropdown-mouseover"></div>
</header>
<div id="menuleft">Menu left</div>
<div id="menuright">Menu Right</div>
<div id="content">
The standard Lorem Ipsum passage, used since the 1500s

"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
</div>

<footer>Footer</footer>

      



CSS

header
{
    position:fixed;
    top:0px;
    left:0px;
    background: #FC7474;
    padding:20px;
    width:100%;
}
#menuleft
{
    position: fixed;
    left:0px;
    top:40px;
        width: 40px; 
      background: green;
    padding:5px;
    height:100%;
}
#menuright
{
    position: fixed;
    right:0px;
    top:40px;
        width: 40px; 
      background: green;
    padding:5px;
    height:100%;
}
#content
{
    padding: 50px;
}
footer
{
    position:fixed;
    bottom:0px;
    background:#000;
    padding:20px;
    width:100%;
    color: #fff;
}

      

FS FIDDLE DEMO

0


source


Change the code HTML

to the following. Also, I replaced your #dropdown {

CSS withdropdown {

HTML:

<header>
    <div id="dropdown">
        <select>
            <option value="0">Select</option>
            <option value="1">Option 1</option>
            <option value="2">Option 2</option>
            <option value="3">Option 3</option>
        </select>
    </div>
</header>
<div id="menuleft"></div>
<div id="content"></div>
<div id="menuright"></div>

<footer></footer>

      

CSS

header {
   position: fixed;
   width: 100%;
   height: 25px;
   background-color: gray;
}

select {
    position: absolute;
}

      

Working DEMO

0


source







All Articles