![]() | |
![]() |
| | Thread Tools | Display Modes |
#21
| |||
| |||
|
|
There is a fairly fairly consistent rendering of the phenomenon you have been wondering about, this is true. So some rules are being followed! I find the the talk of the various contexts, stacking etc not easy to negotiate - to be frank. |
#22
| |||
| |||
|
|
dorayme wrote: There is a fairly consistent rendering of the phenomenon you have been wondering about, this is true. So some rules are being followed! I find the the talk of the various contexts, stacking etc not easy to negotiate - to be frank. The thing about stacking order for layers is that normally we say that elements must be positioned to overlap in order for any z-index to visually take effect. That is to say that the normal condition is that the layers are normally not overlapping, but must be positioned by us to make them overlap and only then can we fruitfully apply z-index to them. Well, in the instance of a float we actually already have the float layered on top of the containing block with line boxes (which we've been calling div#shrink in our examples) and regarding this the spec http://www.w3.org/TR/CSS21/visuren.html#floats> has this to say: .... |
|
Additionally, <http://www.w3.org/TR/CSS21/visuren.html#propdef-z-index provides stacking levels for each stacking context. Appendix E <http://www.w3.org/TR/CSS21/zindex.html> provides a more thorough explanation of the stacking order. Now it's just a matter of re-reading all to get it to sink in. :-) |
#23
| |||
| |||
|
|
I earlier gave an indication of a test for when it has sunk in for a normal human. It was a predictive one, not a hindsight one. I am still not as optimistic as you. The slight thing that worries me in my pessimism is that many browsers *do* the same thing, so someone or some group who programmed the browsers had a certain understanding of these things. However, I can't even be sure of this. It may turn out that the programmers put in a set of rules and one of the consequences is the phenomenon you raised, but it takes a blind machine to bring it out (like a not particularly intended consequence). What would be nice is a model that tells a story that is consistent and meaningful and useful. That one can see in practical circumstances as useful. That one can understand for prediction. I am suspicious of the act of staring at tracts of convoluted human unfriendly systems of rules and saying in hindsight, ah, the penny has dropped. This seems to me to be a different kind of understanding than the one that can predict things. |
#24
| |||
| |||
|
|
We can predict consistent behaviour as soon as we accept that: 1. The float's real estate covers that of the containing block, where both start at 0,0 (without any positioning). Either may have smaller or larger width and/or height. 2. In the instance of a float we actually 'already' have the float layered on top of the containing block with a pre-established stacking order. 3. _Without any positioning applied_ to the containing block, the float has a higher stacking order. The float is on top. 4. _With positioning applied_ to the containing block, the containing block has a higher stacking order. The float is on bottom. 5. _With positioning applied_, the stacking order may be changed by applying z-index to the containing block. |
#25
| |||
| |||
|
|
Gus Richter wrote: We can predict consistent behaviour as soon as we accept that: 1. The float's real estate covers that of the containing block, where both start at 0,0 (without any positioning). Either may have smaller or larger width and/or height. 2. In the instance of a float we actually 'already' have the float layered on top of the containing block with a pre-established stacking order. 3. _Without any positioning applied_ to the containing block, the float has a higher stacking order. The float is on top. 4. _With positioning applied_ to the containing block, the containing block has a higher stacking order. The float is on bottom. 5. _With positioning applied_, the stacking order may be changed by applying z-index to the containing block. I'm still playing around with this and I thought I would share this one: http://www.home.golden.net/~richterf/Stuff/tst_2.html |
#26
| ||||
| ||||
|
|
Here is me again harping about terminology. (I have this idea that it is quite important to be very clear and accurate in these matters). You refer to a div that follows the float in the html as a containing block. |
|
In a sense all divs are this in that they contain things or can. The wrapper you have also contains things, here they contain the float and the non-float divs. They don't seem to be doing anything useful here. |
|
The body already is a container for all examples. |
|
Firefox 2 on my Mac does respond to negative z-indexing btw. |
#27
| |||
| |||
|
|
dorayme wrote: Here is me again harping about terminology. (I have this idea that it is quite important to be very clear and accurate in these matters). You refer to a div that follows the float in the html as a containing block. The spec refers to it as such. I used to refer to it, for my own comprehension and because of lack of a proper name, as the "float box". I believe that they refer to it simply as the "containing block" because it contains and constrains (to 0,0) the float (mostly, since we know that it can and will, also contain line boxes). In a sense all divs are this in that they contain things or can. The wrapper you have also contains things, here they contain the float and the non-float divs. They don't seem to be doing anything useful here. To be honest, it was an easy way to make it all work with all the divs. No problem in that. I have thought about checking-for and reducing-any redundant markup. This is what I now come up with: The "wrapper" is used to wrap and separate each group for an easy way to position/offset each group with a margin-top declaration. The 1st "wrapper" may be removed and the margin applied directly to the containing block it is true, but the next two, since they are relatively positioned, won't work as easily. Try it. The float does not follow. Of course the float and shrink divs are mainly needed/used to give the background colours. The body already is a container for all examples. Right, but to apply properties to a section, divisions come in handy. Firefox 2 on my Mac does respond to negative z-indexing btw. Mac/Firefox 2 is better than Win/Firefox 2, I guess. ;-) |
#28
| |||
| |||
|
|
I guess we have been through a few of these things earlier. I put up an example to strip all the things that I thought were not necessary to show the interesting thing you are raising but I don't think you are too impressed with this! I guess we think differently, I find it helps to get rid of things I see as not relevant to the issue like wrappers to each pair of divs, which wrappers are not given any relevant css, widths that do not affect the basics and so on. This is not meant as some sort of invasion of your stuff, all I can do is say what I find clear and what not and hope you understand. |
|
I am not keen on using any phrase printed by others (including the css specs) if it does not signify something to me in my understanding. I am inclined to actually use the phrase "containing block" where the context shows it to do a job of containing. Your containing blocks don't contain anything obvious (except their own text or pictures, a sense in which most elements are containers). You seem not to be referring to what you are calling wrappers. |
#29
| ||||
| ||||
|
|
dorayme wrote: I guess we have been through a few of these things earlier. I put up an .... I have no problem with your examples as in: http://netweaver.com.au/alt/visibleOrder.html> which I think present the same thing from a slightly different visual view. I am inclined to actually use the phrase "containing block" where the context shows it to do a job of containing. Your containing blocks don't contain anything obvious (except their own text or pictures, a sense in which most elements are containers). The "containing block" is each one of the yellow boxes in every one of your examples on the page linked above (yellow boxes in my examples as well). |
|
It is a bit counter-intuitive in that normally a container comes first in the markup, but in the case with floats, the "container block" comes _after_ the float. |
|
The "container block" contains the float ... [this "container"] is an auto-creation by the appearance of a float - a special feature of the float. |
|
I wanted to answer some more to other points below, but have run out of time. Must do other things today. The meat is in the above anyway. I like your examples. |
#30
| |||
| |||
|
|
I am seeing what you are referring to fine, but it looks like a confusing way of expressing the facts. In fact, it looks like a slight misunderstanding. The float is *not* contained by what you are calling a "container" except in the most superficial way. |
| http://netweaver.com.au/alt/visibleOrder.html Btw, notice how the float and/or the rel pos'd div behave in the last two examples. In the one the float does not exert its magic pushing of the contents in the following div, while in the other it still does even though the div is way clear in appearance. |
|
No worries. I will just get a slab[1] of beers from the fridge and get rotten drunk to pass the time till you get back from work. |
![]() |
| Thread Tools | |
| Display Modes | |
| |