Re: Tabbed Interfaces in CSS

Boris Zbarsky wrote:
> Here's a simple example that you can't do with that approach:
> data:text/html,<!DOCTYPE html><fieldset style="float: 
> left"><legend><span style="color: green">longlong</span><span 
> style="color: blue">long</span></legend>short</fieldset>

I think I misread your testcase; it seems to rely on this magic 
-moz-content thing and on basically using that div as the equivalent of 
a TeX \hphantom.  But here's something that actually can't be done that 
way, for what it's worth:

data:text/html,<!DOCTYPE html><fieldset style="float: 
left">short<br>More short<legend>longlonglong</legend></fieldset>

(doesn't render in Presto or IE7 like it does in Webkit or Gecko, but 
sites do depend on the latter rendering in at least branches of their 
browser-sniffing in my experience; when we tried to require legend to be 
the first kid of a fieldset at one point, sites broke).  In particular, 
the y offset if you're going to use positioning like that has to depend 
on the layout of other things in the fieldset.  Not really expressible 
with CSS...

Seriously, I'm not a huge fan of the way legend/fieldset works in Gecko 
right now.  For one thing, I have to maintain that code; I'd much prefer 
to replace it with some CSS rules, and would have done that years ago if 
I could have.  It's just not as simple to get web-compatible 
legend/fieldset behavior as it might seem.


Received on Sunday, 26 April 2009 00:56:24 UTC