...

View Full Version : Css text padding?



Andy92
04-28-2006, 08:54 AM
Hi there,

I have 1 image, then i have some text below that image then i have 1 div box around them.

But as the text is right below the image, its nearly touching the image, so is there such thing as text padding top, bottom etc. So you can apply it and it will only padd the text at the top and bottom etc ? So then my text can just have padding at the top so it won't touch the image? :)

ronaldb66
04-28-2006, 09:55 AM
A link to the page online, or the markup and styles posted in here--using the CODE bb tags--would help, but text--and inline content in general--does not support top and bottom padding and margins; however, if you've marked up the caption with, for instance, a p element which is a block level element, the p can be assigned vertical padding and/or margins to separate it from the image.

Andy92
04-28-2006, 02:39 PM
Ive used the <p> tag and its much too big gap.

I think i have found a solution by doing it another way. Ill check it out and get back to you.

:thumbsup:

Arbitrator
04-28-2006, 02:57 PM
When using the paragraph tag, try setting padding and margin to zero first and then adding padding or margin values as necessary; this should override any default padding or margin values that the p tag may have been assigned by the browser.

Andy92
04-29-2006, 12:55 PM
What i might try is making a <div> tag 3px high and then insert that between the image and the text. :thumbsup:

kewlceo
04-29-2006, 01:00 PM
What i might try is making a <div> tag 3px high and then insert that between the image and the text. :thumbsup:
Why on earth would you do it that way?

Andy92
04-30-2006, 03:12 PM
What other way can you do it ?

kewlceo
04-30-2006, 03:49 PM
What other way can you do it ?
Using Arbitrator's suggestion, for instance. :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum