Re: [css-d] clear: both + negative margin -- should it do anything?
On 3 Feb 2006, at 4:42 pm, Christian Montoya wrote: In my test case above, Firefox (1.5) and Safari (1.0 and up) are correct. Now that I see the latest standard, I concur. At least, as far as I can interpret it, that is: clear means add to the top margin a value equal to the height of the clear. If the margin is less than the height of the clear, then the added value will always result in the height of the clear, and it will always look the same. Only when the margin is greater than the height of the clear, nothing is added. So the first case is 0 + 80 = 80. The next is 80 + 0 = 80. The next is 100 + 0 = 100. The last is -1 + 81 = 80. That is the correct assessment for the value of the computed margin- top in those cases. Not a very helpful implementation I guess? ? The css 2.1 wording is quite clear, I think. As far as implementations go, Opera has still some work to do, and IE maybe (depending on how IE 7 handles margins, margin-collapsing, etc), and iCab. - Isn't an alternative also to give the floated element a bottom margin? If you want to make sure there is some separation space between the floated box and the (cleared) subsequent block, that is the way to go, as you never know how tall (computed height) the floated block will be, except if the height is locked in pixels (i.e. an image). Philippe --- Philippe Wittenbergh http://emps.l-c-n.com/ __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] clear: both + negative margin -- should it do anything?
Philippe Wittenbergh wrote: http://dev.l-c-n.com/_temp/clear-marginTop.php ... In my test case above, Firefox (1.5) and Safari (1.0 and up) are correct. Firefox 1.0 does a slight poopoo with the neg. margin. IE 6 Win is half correct (test 2 and 3), probably more by accident. As for Opera, all versions tested are wrong, from 7.54 to 9 TP1, each in a different way. And iCab is wrong as well (add the specified margin to the clearing box, but consistent). Good old IE Mac is wrong on the negative margin test, can't blame it too hard, due to the ambiguities in the CSS 2.0 wording. IE 7 Win ?? (if anyone could post a screenshot, and file a bug if needed...). Philippe, IE7b2 http://www.satzansatz.de/phw/clearmargintop.jpg Best, Ingo -- http://www.satzansatz.de/css.html __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] clear: both + negative margin -- should it do anything?
For anyone who's interested, I put up a test page with screenshots There is no test case there, only screen shots. Sorry for the confusing terminology; I didn't mean that the page had a test case. (I'm trying to compare different browser renderings for a project I'm working on, so screenshots all on one page were most useful for my purposes.) I added a live demo to the bottom of the page to make it more useful to others, although of course yours is way, way nicer. When quoting the specs, it is a good idea to refer to the latest one; Oh, sorry again -- I referred to the latest recommendation rather than the latest draft. I'm not sure that the latest draft is really any clearer, though... IE 6 Win is half correct (test 2 and 3), probably more by accident. Yeah, that was my conclusion as well. :) From Ingo's IE7b2 screenshot, it looks like nothing has changed yet. cheers, Lori __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] clear: both + negative margin -- should it do anything?
IMHO, the bug filer's conclusion is backwards; it seems totally logical to me that setting a top margin on the clear that's larger than the size of the floats would in effect result in a margin of [margin as set] - [height of float]. For anyone who's interested, I put up a test page with screenshots and various theories as to what's going on. http://www.avocado8.com/testing/margin_clear.html Lori __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] clear: both + negative margin -- should it do anything?
On 3 Feb 2006, at 2:26 am, Lori Hylan-Cho wrote: IMHO, the bug filer's conclusion is backwards; it seems totally logical to me that setting a top margin on the clear that's larger than the size of the floats would in effect result in a margin of [margin as set] - [height of float]. For anyone who's interested, I put up a test page with screenshots and various theories as to what's going on. http://www.avocado8.com/testing/margin_clear.html There is no test case there, only screen shots. Here is my test-page (I used a more heavy negative margin in one case, to make the behaviour more obvious). http://dev.l-c-n.com/_temp/clear-marginTop.php When quoting the specs, it is a good idea to refer to the latest one; in this case http://www.w3.org/TR/CSS21/visuren.html#flow-control which explains much better what should happen. In my test case above, Firefox (1.5) and Safari (1.0 and up) are correct. Firefox 1.0 does a slight poopoo with the neg. margin. IE 6 Win is half correct (test 2 and 3), probably more by accident. As for Opera, all versions tested are wrong, from 7.54 to 9 TP1, each in a different way. And iCab is wrong as well (add the specified margin to the clearing box, but consistent). Good old IE Mac is wrong on the negative margin test, can't blame it too hard, due to the ambiguities in the CSS 2.0 wording. IE 7 Win ?? (if anyone could post a screenshot, and file a bug if needed...). Philippe --- Philippe Wittenbergh http://emps.l-c-n.com/ __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] clear: both + negative margin -- should it do anything?
On 2/2/06, Philippe Wittenbergh [EMAIL PROTECTED] wrote: In my test case above, Firefox (1.5) and Safari (1.0 and up) are correct. Now that I see the latest standard, I concur. At least, as far as I can interpret it, that is: clear means add to the top margin a value equal to the height of the clear. If the margin is less than the height of the clear, then the added value will always result in the height of the clear, and it will always look the same. Only when the margin is greater than the height of the clear, nothing is added. So the first case is 0 + 80 = 80. The next is 80 + 0 = 80. The next is 100 + 0 = 100. The last is -1 + 81 = 80. Not a very helpful implementation I guess? - Isn't an alternative also to give the floated element a bottom margin? -- -- Christian Montoya christianmontoya.com ... rdpdesign.com ... cssliquid.com __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
[css-d] clear: both + negative margin -- should it do anything?
I'm looking at a bug report[1] regarding margins and clears, and I'm wondering if it's really a bug at all. Since the spec says that when clear is applied, the top margin of the generated box is increased enough that the top border edge is below the bottom outer edge of any [left|right] floating boxes that resulted from elements earlier in the source document, should applying a negative margin to the clearing element have any effect? [1] http://www.quirksmode.org/bugreports/archives/2006/01/clearboth_margin_bug.h tml cheers, Lori __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] clear: both + negative margin -- should it do anything?
On 2/1/06, Lori Hylan-Cho [EMAIL PROTECTED] wrote: Since the spec says that when clear is applied, the top margin of the generated box is increased enough that the top border edge is below the bottom outer edge of any [left|right] floating boxes that resulted from elements earlier in the source document, should applying a negative margin to the clearing element have any effect? The way the spec puts it, it sounds like doing a clear basically gives the box a top margin auto equal to the height of the box it's clearing. Changing that margin to -1px seems like you would be taking away the top margin, and thus would be counter intuitive? Looking at the examples, I would say that FF 1.07 is completely off. The negative margin puts the cleared box below the previous box, which doesn't make sense at all; the cleared box comes later in the source and should overlap, not under. The comparison is between IE 5/6 and FF1.5/Opera/Safari. The former seems to be adding the margin to the auto generated by the clear, and the latter seems to be forcing the top margin to stay at the auto generated by the clear. I do agree that this is too much of a gray area to call it a bug, since it is probably due more to the way clears are implemented in the different engines, than a misinterpretation of the specs. I tried to comment at quirksmode, but it kept throwing errors. I gave up. -- -- Christian Montoya christianmontoya.com ... rdpdesign.com ... cssliquid.com __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] clear: both + negative margin -- should it do anything?
The way the spec puts it, it sounds like doing a clear basically gives the box a top margin auto equal to the height of the box it's clearing. Changing that margin to -1px seems like you would be taking away the top margin, and thus would be counter intuitive? Yeah, that's what I was thinking. It's hard to know what -1px really means in this case. I do agree that this is too much of a gray area to call it a bug, since it is probably due more to the way clears are implemented in the different engines, than a misinterpretation of the specs. Probably true. IMHO, the bug filer's conclusion is backwards; it seems totally logical to me that setting a top margin on the clear that's larger than the size of the floats would in effect result in a margin of [margin as set] - [height of float]. Thanks for your input, Christian! cheers, Lori __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/