W3C home > Mailing lists > Public > www-style@w3.org > November 2003

[CSS PROPOSAL] legend & fieldset

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Tue, 25 Nov 2003 00:02:40 -0600
Message-ID: <3FC2F080.2000301@mit.edu>
To: www-style@w3.org

I'm posting the proposal below for Anne van Kesteren since it appears 
that mail from here does not make it to this list for some reason... 
The proposal arose out of a discussion about styling the <legend> 
element in HTML and the fact that you can't do it very well in some 
browsers (eg can't make it behave as a block).

-----------------------------------------------------

*Additional values for the 'display' property*

Name:              display
New Values:        fieldset | inline-fieldset | legend
Initial:           inline
Applies to:        all elements
Inherited:         no
Percentages:       N/A
Media              all

fieldset
   Equal to the HTML equivalent <fieldset/>

inline-fieldset
   Equal to the HTML equivalent <fieldset/> with 'display:inline-block;'
   applied to it.

legend
   Equal to the HTML equivalent <legend/>.


*'legend-position' property'*

Name:              legend-position
Values:            [ [top | bottom | left | right] ||
                      [<percentage> | <length>]* ]
Initial:           top
Applies to:        legend
Inherited:         no
Percentages:       refer to the size of it's parent
Media              visual

top, bottom, left and right
   Same as 
<http://www.w3.org/TR/html401/interact/forms.html#adef-align-LEGEND>


This property applies to all legend elements. It specifies the position 
of the legend element within it.

Example:

  HTML
   <outer>
     <inner/>
   </outer>

  CSS
   outer{ display:fieldset; }
   inner{ display:legend; }

   outer{ legend-position:bottom 40px; /* 40px to the right from the
                                          bottom-left edge of the 'outer'
                                          element */
        }
   outer{ legend-position:right 50%;   /* 50% down from the top-right
                                          edge of the 'outer' element */
        }


*Addtional values for the 'appearance' property*

Name:              appearance
New Values:        fieldset | inline-fieldset | legend
Initial:           inline
Applies to:        all elements
Inherited:         no
Percentages:       N/A
Media              interactive

fieldset
   Specifies the default system style for the fieldset elements.

inline-fieldset
   specifies the default system style for the inline-fieldset elements.

legend
   Specifies the default system style for the legend elements.


*HTML UA STYLE SHEET*

The HTML UA style sheet can be extended in the following way:

  fieldset{
   display:fieldset;
   appearance:fieldset;
  }
  legend{
   display:legend;
   appearance:legend;
   legend-position:top;
  }
  legend[align]{
   legend-position:attr(align);
  }
Received on Tuesday, 25 November 2003 01:11:22 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:25 GMT