padding an element

liunx

Guest
how exactly do you right out a div style for padding the top and bottom of an image and separately the style for padding the left and right value?<br />
<br />
<br />
I want to apply it so some but not all images in my HTML page, so it will either have to be written locally around each image or as a style which I would have to refer to using a div tag.<!--content-->you can write 2 separate classes of style and use them appropriately for images<!--content-->The reason I am writing my question is because I wrote out the style and it is not working. I'm trying to troubleshoot to see if I'm not writing it out correectly or if padding doesn't work w/ images. Do you know how exactly to write it out?<br />
<br />
<br />
thanks!<!--content--><style type="text/css"><br />
<!--<br />
div {<br />
padding-left: 15px;<br />
padding-right: 15px;<br />
padding-top: 10px;<br />
padding-bottom: 10px;<br />
}<br />
--><br />
</style><br />
<br />
any help?<!--content-->rereading your question you should probably apply that to the image.<br />
<br />
<style type="text/css"> <br />
<!-- <br />
div img { <br />
padding-left: 15px; <br />
padding-right: 15px; <br />
padding-top: 10px; <br />
padding-bottom: 10px; <br />
} <br />
--> <br />
</style><br />
<br />
This one will only apply to images which are within a div.<!--content-->Hmm... I just don't get why people keep adding <!-- --> tags around their styles. It's only needed for some of the very few people left using older versions of Netscape... Opera and Internet Explorer all run the styles perfectly without those tags.<!--content-->Originally posted by Lotus <br />
Hmm... I just don't get why people keep adding <!-- --> tags around their styles. It's only needed for some of the very few people left using older versions of Netscape... Opera and Internet Explorer all run the styles perfectly without those tags. <br />
<br />
It's not exactly a difficult thing to do is it? And at least you're left with an accessible page, which lets face it, is pretty much the point of css...<br />
<br />
I had a machine with IE 5.something which would hang for ages without the comment tags.<!--content-->
 
Back
Top