Difficulty with css file and padding property.

  Dae 18:18 12 Oct 2004
Locked

Can anyone kindly suggest why this line from a css file, which I have copied and pasted here, only partially works?

img {float:left; padding-right:25px}

The image floats on the left all right, with following text appearing to the right of the image. To separate the image and text a bit more, I added the padding property, as above. But the space between image and text did not change. I have tried experimenting with a few different values for the padding property but they have no effect; the text remains very close to the right-hand edge of the image.

All this is in IE6 + SP2, in a linked .css file.

Regards.

  Dae 18:35 13 Oct 2004

I have discovered that a line works all right
(ie it adds the space I want) if it ends

margin-right:20px}
margin-right:20px;} also works.
padding-right:20px} does not work.
padding-right:20px;} does not work

So I am thinking my difficulty is associated with the 'padding' property. Can you have padding in a jpg image file - perhaps not?

I am reading a book (reputable publisher, Peachpit Press, marked 'Copyright 2005', so probably up-to-date) where all the style rule examples are written without a ; before the final curly/brace bracket - that's where I got the idea from in the first place.

I shall mark this thread closed, whilst I delve more into padding and margins and under what circumstances a final ; before the } is needed.

Thank you for your interest.

Regards.

Dae.

  Dae 18:51 13 Oct 2004

I shall try that second paragraph again. The forum mechanism has mangled it a bit. Each example is supposed to be on a new line.

margin-right:20px} works.

margin-right:20px;} also works.

padding-right:20px} does not work.

padding-right:20px;} does not work.

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

Best phone camera 2017

Stunning new film posters by Hattie Stewart, Joe Cruz & more

iPad Pro 10.5in (2017) review

28 astuces pour profiter au mieux de votre iPhone