[thelist] div elements

Chris Kaminski chris at setmajer.com
Fri Jun 7 16:48:00 CDT 2002


Thus spake Pablo Oliva:

> You're right, span does work.  I thought that I had tried that previously
> and it did not give me the padding that I had specified.  Maybe it was on an
> older browser or something... who knows.  But thanks for your help.

IIRC, IE5/Win doesn't like adding padding to inline elements, so check if
that browser is important to you.

To do what you're trying with <div>s, try:

<div class="imageDiv"><img src="foo1.gif" /></div>
<div class="imageDiv"><img src="foo2.gif" /></div>
<div class="imageDiv"><img src="foo3.gif" /></div>


Then in either and embedded or external stylesheet use:

.imageDiv {
    float: left;
    padding: 1em; /*or whatever value you like*/
    }



chris.kaminski == ( design | code | analysis )

------------------------------------------------------------
    There is not a man in America who has not
    had a secret ambition to boot an infant.
    --------------------------------------<< W. C. Fields >>




More information about the thelist mailing list