Difficulty with css file and padding property.

  Dae 18:18 12 Oct 04
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 04

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 04

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.

What is Amazon Go and will it come to the UK? The store without checkouts or queues

1995-2015: How technology has changed the world in 20 years

Why ecommerce hasn't taken off on social media

New MacBook Pro 2016 review | MacBook Pro with Touch Bar review: Apple's expensive and powerful…