Control text wrapping around boxes

M

Marc

I have seen many CMS packages wrap text around a box such as the one
at http://www.armchairdictator.com/index.php?art/id:5

but the text is always far too close to the box on the page. How does
one create padding around boxes like this one? I think that with
images you can add a padding parameter (or maybe not) to space text a
distance away from crowding the graphic. Thank you.
 
B

Bernhard Sturm

Marc said:
I have seen many CMS packages wrap text around a box such as the one
at http://www.armchairdictator.com/index.php?art/id:5

but the text is always far too close to the box on the page. How does
one create padding around boxes like this one? I think that with
images you can add a padding parameter (or maybe not) to space text a
distance away from crowding the graphic. Thank you.

you could add padding to your float box (as in the above case):

<div id="authorbox">
<img src="out/avatar/1_authoricon.png" alt="author" />
Text
</div>

div#authorbox {
float:left;
margin: 3px; /* 3px margin of the box to each side */
padding: 3px; /* 3px padding within the box to each side */
}
div#authorbox img {
margin:2px; /* margin of the image to the text on each side */
}

please refer to the box model specs fron the W3C:
http://www.w3.org/TR/REC-CSS2/box.html

HTH
bernhard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top