We help IT Professionals succeed at work.
Get Started

Keeping an image within a div

Rowby Goren
Rowby Goren asked
Last Modified: 2012-05-09
I think this is a float / clear float issue, which I don't have my brain quite wrapped around yet...

Please go to this page, work in progress :):


Whenever there is an image for one of the sandwiches, I need to make sure that the bottom dotted border line has some nice padding after the product image -- if there is an image present..

As you can see, the image for the "Thanks A Lot" sandwich slightly overlaps the bottom dotted line border.  That's my problem .

The "Wise Guy" sandwich doesn't have this problem only because there is some text in the description of the sandwich.

And the sandwiches which do not have images appear to be behaving with nice padding, etc.

They are all within a container called  <div class="s5_browseProductContainer">

So, as I said,  I think the problem may have something to do with floats and clearing floats -- and maybe there needs to be some divs added or rearranged if necessary????

Below is the php code.  I promise not to touch it until you folks are finished here.

<div class="s5_browseProductContainer">
  <h2><?php echo $product_name ?>  </h2>
    <p ><?php echo $product_price ?></p>
 <div id="rowby-thumb"> <?php echo ps_product::image_tag( $product_thumb_image, 'class="browseProductImage" border="0" title="'.$product_name.'" alt="'.$product_name .'"' ) ?><br style="clear:both;" /><div align="center"></div>
   <br style="clear:both;" /></div> 
    <?php echo $product_desc ?>
  <?php echo $form_addtocart ?>

Open in new window

Watch Question
Senior Systems Manager
This problem has been solved!
Unlock 3 Answers and 9 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE