Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image padding not working 1

Status
Not open for further replies.

Stoemp

Programmer
Sep 25, 2002
389
BE
Hi

I have a problem with the lay-out of a paragraph with an image inside. I want to let the image float to the left and get a space of 10px between the image and the text. This is my code:
Code:
<p class="pBodyTekst"><img src="../maps/mr1.jpg" style="border: solid 1px black; float: left; padding-right: 10px; padding-bottom: 10px; width: 150px; height: 97px;" alt="MR-1" />Omschrijving voor de Mini Rocker Shaker</p>

Apparently there's no padding to the right of the image.

Does anyone know what I do wrong?

Thanks

Steven
 
it's because the padding attribute applies to a container and sets a distance between the container's margins and the children's position. In your case you need to use the margin attribute.
Code:
<p class="pBodyTekst"><img src="../maps/mr1.jpg" style="border: solid 1px black; float: left; margin-right: 10px; margin-bottom: 10px; width: 150px; height: 97px;" alt="MR-1" />Omschrijving voor de Mini Rocker Shaker</p>
 
This works indeed! Thanks a lot!

Steven
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top