Thursday, August 17, 2006

[HTML] Padding around pics?

This is my first post in the 'scool!

I just posted on my blog and part of the post is photo files of cookbook covers. In Blogger, the preview looks great...but when published, there seems to be white padding around each pic file. I went into the edit HTML page and tried to remove the padding by placing a 0 in front of the number of pixels for padding/border around each of the pic files. That didn't fix the problem and now the text around the pic files is out of whack. Anyone know how I might fix this?


This Post was written by Elizabeth from http://www.elizabeth-spice.blogspot.com

5 comments:

SusanV said...

Did you take the photos yourself, or did you copy them from Amazon or somewhere? If it's the latter, they are probably padded like that by the source website, which has them all formatted alike to fit into their template. In other words, you'd have to open them in Photoshop or another image program and crop out the whitespace.

I am Jack's Brain said...

The padding is actually in the image itself. You could always crop the image to get rid of it.

Nandita said...

I was planning to post this query too...even though I;ve set border=0, there is this green border outside my pics, i just cant get rid of it...will someone please check out my blog and tell me- the url is http://saffrontrail.blogspot.com

paul said...

Nandita, the border around your images in your posts are added in your style sheets. So change the border value in this code in the CSS portion of your code:

.post img {
margin:0 0 5px 0;
padding:4px;
border:1px solid #586;
}

You could also add it to the styles inside your image tag like this:

style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand; border: 0px;"

Although it's a mystery to me why the border="0" you put in wouldn't override any style applied in the CSS. The border attribute isn't allowed in a the strict document type, but it still should work. But do it the 'correct' way in the styles and it'll be fine.

Nandita said...

Thanks a ton Paul, I'm going to change it right away and see if it works. Will get back to you on this-in case I have any doubts.