March 22, 2012

CSS DIV Overflow

Question by Devin

Site: http://partsconsign.com/parts/?custid=1

I don’t know what happened. All of a sudden, without changing the css, when I expand the “browse” categories, they overflow outside of the containing divs. Here is the css of the divs:

.bodyArea
{
    width: 900px;
    background-image:url(/images/bg.jpg);
    background-repeat:no-repeat;
    border-width: thin;
    border-style: solid;
    margin-left:auto;
    margin-right:auto;
    -moz-border-radius: 8px;
    border-radius: 8px;
    min-height: 900px;
}

.pageArea
{
    background-image: url(../images/page_bg.jpg);
    background-repeat: repeat;
    width: 95%;
    position:relative;
    margin-left: 25px;
    margin-top: 30px;
    min-height: 700px;
    height:auto;
}

#partCat {
    width: 775px;
    padding:5px;
    cursor:pointer;
}

I don’t see why expanding these divs would cause any kind of overflow. None of these divs have any absolute positioning. What am I doing wrong? #partcat is within .pageArea, which is within .bodyArea. I’ve looked through many questions asked previous here, but all of them seem to have slightly different issues. Help!

Answer by Starx

You div is fixed on 30px height. Remove the height from this part

<div style="height: 30px; width: 100%">

Tested through the firebug, IT WORKS

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!