RussellHarrower
RussellHarrower

Reputation: 6820

CSS content div with menu div

ok I am having this small issue with CSS. I have a menu div that is height 100% and needed to use the following to get it to work

#menu {
  background:#222;
  width:120px !important;
  float:left;
  position: absolute;
  top: 30px;
  bottom: 0px;
}

on my content area I have this CSS

#content {
  float:left;
  display:block;
  height:300px !important;
  background:#333;
  width:100%;
}

demo here: jsFiddle - P3Adk

as you will see the content is under the menu which is what I dont want. I want it to be next to the menu flushed left.

Upvotes: 0

Views: 214

Answers (3)

Manish Sharma
Manish Sharma

Reputation: 1720

Try this:

#content {  
    height:300px; 
    width:100%; 
    background:#333; 
}
.content-inner {
    position:relative; 
    margin-left: 130px; 
    border:1px solid #F00; 
}
#menu { 
    float: left; 
    z-index: 1; 
    position: absolute; 
    left:0; 
    top:30px; 
    bottom:0; 
    width:120px; 
    background:#222; 
}

http://jsfiddle.net/kpjqz/

Upvotes: 0

user1686933
user1686933

Reputation:

Did you try something like the following one:

#content{
    display:block; 
    height:300px !important; 
    background:#333; 
    width:100%;
    margin:30px 0 0 120px;
}
#menu{
    background:#222;
    width:120px !important;
    float:left;
    position: absolute; 
    top: 30px; 
    bottom: 0px;
}​

Upvotes: 2

mash
mash

Reputation: 15229

Like this?

Just remove the position:absolute from the menu div, give the content div a percent width, the menu div a percent width (or fixed pixel widths), and a height.

Upvotes: 0

Related Questions