Padding an Image

liunx

Guest
Hi!<br />
<br />
<br />
I'm trying to apply padding around some images, but it's only working on macs, not on PCs.<br />
<br />
<br />
This is the code I'm using:<br />
<br />
<br />
<STYLE TYPE="text/css"><br />
body {background: #5CD6AD url(images/contentpagegreenbg.jpg) repeat-x;} <br />
<br />
.pad {padding-left: 15px; <br />
padding-right: 15px; <br />
padding-top: 10px; <br />
padding-bottom: 10px; } <br />
<br />
.pad2 {padding: 25px;} <br />
<br />
</STYLE> <br />
<br />
<br />
<br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"home.html"><img class="pad2" src="images/legal.gif"></A><br />
<br />
<br><br />
<br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"content.html"><img class="pad" src="images/core.jpg"><!--content-->Padding is a block element property. Maybe that is why it doesn't work in some browsers. I know you can use the HTML border attribute on an image to do the same thing, but that isn't CSS. If you can't get it right, enclose the IMG in a SPAN and apply the padding to the SPAN. Or, since you already have the image inside an A tag, apply the class to the A tag.<!--content-->
 
Back
Top