Tim Arnold wrote: > On Thu, Aug 19, 2010 at 9:39 AM, Alan Gresley <a...@css-class.com> wrote: > >> I should remind myself. Floating an element causes it to display as a >> block. Also width and margin values are used. >> >> Lucky me, I didn't need Philippe to remind me this time. >> >> >> -- >> Alan http://css-class.com/ >> >> > I'm not so sure that it causes it to display as block so much as makes the > styles noticeable when they might not otherwise be. On the same test page, > the second image has no float and all rules are still applied. I changed > the margin from right to left to make it more apparent. > > Cheers, > Tim > > ----------------------------------------- > tim.arn...@gmail.com
It's in the spec [1]. The computed value for float is set to block which causes an element to generate a block box [2]. I am completely wrong about IMG when it is display inline. A margin, width or height is applied since an IMG is a inline replaced element. I also wrong about inline non replaced elements. Width and height are not applied but horizontal margin values that are not auto are used. 1. <http://www.w3.org/TR/CSS21/visuren.html#float-position> 2. <http://www.w3.org/TR/CSS21/visuren.html#propdef-display> -- Alan http://css-class.com/ Armies Cannot Stop An Idea Whose Time Has Come. - Victor Hugo ______________________________________________________________________ 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/