On Thu, Aug 19, 2010 at 3:47 AM, Alan Gresley <a...@css-class.com> wrote:

> Since IMG are inline elements, then any margin or width values will
> not be used. For the margin and width values to work, one must make
> the IMG display as a block element.
>
> .floatL {
>   float:left;
>   margin: 0 1 em 1em;
>   padding: 0.25em;
>   display: block;
> }
>
>
Actually "display: block;" is not necessary for images to correctly have
width, margin and padding applied to them.  Here is my test page I threw
together to be sure:

http://extranets.beaconfire.us/test/imgfloat.html

Using this CSS:  img {width: 100px; float: left; margin-right: 40px;
padding-bottom: 40px;}

All styles are applied correctly without "display: block;" in all browsers.
Note, the actual width of the image is 267px.

-Tim


-- 
-----------------------------------------
tim.arn...@gmail.com
______________________________________________________________________
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to