4 ms·
On number 3, that behavior is exactly what I would expect. Not sure what other logical behavior you would propose... The other options don't make sense: "A) A
by dntrkv 10y ago
On number 3, that behavior is exactly what I would expect. Not sure what other logical behavior you would propose...
The other options don't make sense:
"A) Aligned horizontally with the first two, but after both of them?"
Floats are taken out of the normal flow so they will be pulled as far to the side as possible until they reach another floated element or the edge of the BFC.
"B) On the row after the first two, on the far left side?"
"C) On the row after the first two, on the far right side?"
They are floated elements in the same BFC, if they fit on the same line, they will. Unless you clear them. Pretty simple stuff.
- isaaclyman 10y agoI'm mostly with you, but it seems like an antipattern to ignore HTML structure like that.
- have_faith 10y agoIt doesn't ignore HTML structure, it ends up like it does precisely because it iterates through the structure in order when moving the boxes to either side. It makes it fairly predictable if you just loop through the structure in your head and push the boxes to the side they are floated at.
- freeone3000 10y agofloat deliberately takes elements out of content flow ("ignores HTML structure"). That's its entire thing. That's its deal. You don't want that? Don't use float.
- freeone3000 10y agofloat deliberately takes elements out of content flow ("ignores HTML structure"). That's its entire thing. That's its deal. You don't want that? Don't use float.
- lucideer 10y agoIt's satire. The most obvious behaviour was left out of the MCQ deliberately to frustrate the reader.
- dntrkv 10y agoWell obviously it's satire, but I don't think the actual behavior was left out to frustrate the reader. The joke is that those 3 options offered would be the logical answers to the question, but the actual answer is somehow less logical than the answers offered, which I don't believe is the case. But yes, we're probably being a little too hard on this piece, being satire and all... Then again, what else do you expect from the HN audience?