Problem with DIV's

C

Chris Leonard

Hi.

I have a very simple page with just 2 DIVs on, a left hand menu bar and a
'main' screen

The menu bar has a different background colour to the main screen.
Everything works fine until I add a lot of content to the main screen and
the page height is greater then a screen. As soon as I scroll down my left
hand DIV's background colour disappears!

What am I doing wrong please ?

TIA

Chris

#left
{
TOP: 0px;
LEFT: 0px;
WIDTH: 150px;
HEIGHT: 100%;
MARGIN: 0px;
POSITION: absolute;
background-color: #C48532;
}

#main
{
TOP: 120px;
LEFT: 150px;
WIDTH: 70%;
POSITION: absolute;
font-size: 80%;
font-family: 'Trebuchet MS', 'Lucida Grande',
Verdana, Lucida, Geneva, Helvetica,
Arial, sans-serif;
MARGIN: 20px;
background-color: #FFFFCC;
}
 
K

Kae Verens

Chris said:
Hi.

I have a very simple page with just 2 DIVs on, a left hand menu bar and a
'main' screen

The menu bar has a different background colour to the main screen.
Everything works fine until I add a lot of content to the main screen and
the page height is greater then a screen. As soon as I scroll down my left
hand DIV's background colour disappears!

What am I doing wrong please ?

TIA

Chris

#left
{
TOP: 0px;
LEFT: 0px;
WIDTH: 150px;
HEIGHT: 100%;

there's the culprit - height:100% means "same height as the holding
block" - in this case, it means <body>. get rid of the height.

If you need the columns to be the same height, then use one of the
solutions at http://glish.com/css

oh - and lowercase code is easier to read.

Kae
 
C

Chris Leonard

there's the culprit - height:100% means "same height as the holding
block" - in this case, it means <body>. get rid of the height.
Thanks

oh - and lowercase code is easier to read.

Interesting, I was going to change it all to upper case as I thought that
would be easier to read.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,079
Messages
2,570,574
Members
47,207
Latest member
HelenaCani

Latest Threads

Top