CSS content overflowing containing div

Posted by kaese on Stack Overflow See other posts from Stack Overflow or by kaese
Published on 2011-01-17T16:43:38Z Indexed on 2011/01/17 19:53 UTC
Read the original article Hit count: 218

Filed under:
|
|
|
|

Hi,

Currently have a problem with some DIVs overlapping their containing DIVs. See image below (the 3 products at the bottom):

alt text

All the body content of the page is held within the #content DIV:

div#content {
    width: 960px;
    float: left;
    background-image: url("../img/contentBg.png");
    background-repeat: repeat;
    margin-top: 10px;
    line-height: 1.8em;
    border-top: 8px solid #5E88A2;
    padding: 10px 15px 10px 15px;
}

And here is the CSS for the product boxes within the #content div:

.upper {
    text-transform: uppercase;
}
.center {
    text-align: center;
}
div#products {
    float: left;
    width: 100%;
    margin-bottom: 25px;
}
div.productContainer {
    float: left;
    width: 265px;
    font-size: 1em;
    margin-left: 50px;
    height: 200px;
    padding-top: 25px;
    text-align: right;
}

div.product {
    float: left;
    width: 200px;
}
div.product p {
}
div.product a {
    display: block;
}
div.product img {
    float: left;
}
div.product img:hover {
    opacity: 0.8;
    filter: alpha(opacity = 80);
}
div.transparent {
    opacity: 0.8;
    filter: alpha(opacity = 80);
}

And here is the HTML for the boxes:

        <div class="productContainer">
            <div class="product">
                <h2 class="upper center">A2 Print</h2>

                <a href='../edit/?productId=5&amp;align=v' class='upper'>                   <img src="../../wflow/tmp/133703b808c91b8ec7e7c7cdf19320b7A2-Print.png" alt="Representation of image printed at A2 Print through MyPersonalPoster." /></a>
                <p class="upper">16.5 inches x 23.4 inches<br /><strong>&pound;15.99</strong></p>
                <p class="upper smaller"><em><span><span class="yes">Yes</span> - your picture quality is high enough for this size</span>                  </em></p>

                <p><a href='../edit/?productId=5&amp;align=v' class='upper'><span>Select</span></a></p>                 
            </div>

        </div>

        <div class="productContainer">
            <div class="product transparent">
                <h2 class="upper center">A1 Print</h2>
                <a href='../edit/?productId=11&amp;align=v' class='upper'>                  <img src="../../wflow/tmp/133703b808c91b8ec7e7c7cdf19320b7A1-Print.png" alt="Representation of image printed at A1 Print through MyPersonalPoster." /></a>
                <p class="upper">23.4 inches x 33.1 inches<br /><strong>&pound;19.99</strong></p>
                <p class="upper smaller"><em><span><span class="no">Warning</span> - your picture quality may not be sufficient for this size</span>                    </em></p>


                <p><a href='../edit/?productId=11&amp;align=v' class='upper'><span>Select</span></a></p>                    
            </div>
        </div>

        <div class="productContainer">
            <div class="product transparent">
                <h2 class="upper center">Poster Print (60cm x 80cm)</h2>
                <a href='../edit/?productId=12&amp;align=v' class='upper'>                  <img src="../../wflow/tmp/133703b808c91b8ec7e7c7cdf19320b7Poster-Print-(60cm-x-80cm).png" alt="Representation of image printed at Poster Print (60cm x 80cm) through MyPersonalPoster." /></a>
                <p class="upper">23.6 inches x 31.5 inches<br /><strong>&pound;13.95</strong></p>

                <p class="upper smaller"><em><span><span class="no">Warning</span> - your picture quality may not be sufficient for this size</span>                    </em></p>

                <p><a href='../edit/?productId=12&amp;align=v' class='upper'><span>Select</span></a></p>                    
            </div>
        </div>

Any idea what could be causing these DIVs to overlap? What I'd like is for all the boxes to fit within the #container div as expected. It's driving me crazy!

Cheers

© Stack Overflow or respective owner

Related posts about html

Related posts about css