Treemodel look-a-like syntax for CSS: possible ?

I'm new to these w3 mailinglist, so I don't really have a clue how all this works, hope I'm doing right by mailing my message ot www-style@w3.org ? :S :P

A few days ago the idea came up, to use CSS like the model of the real document, the document model. This way it would represent the structure of the document much better than it does in css1/2. I don't know if this idea was discussed before, if so, could anyone give me any links to these ?


An examples of the idea:

The document:
<html>
   body>
     <form name="frmFormElement" class="stlFormElement>
        <div>
             <span>
                 <label for="txtInput">This is some input</label>
                 <input type="text" name="txtInput" />*
             </span>
             <input type="submit" value="Click here to submit .." />
        </div>
        <span>The fields marked with a * are required</span>
     </form>
     copyright by the author of this page
  </body>
</html>

The old way of making the css should be something like this:
old css look
* { font-family: Verdana; font-size: 10pt; }   /* Standard font for all elements */

form.stlFormElement div span label
{
    margin-left: 10px;
    margin-right: 5px;
}

form.stlFormElement div span input
{   font-weight: bold; }

form.stlFormElement div 
{   color: red; }

form.stlFormElement input
{   padding: 5px; }

form.stlFormElement span
{   font-size: 8pt; }

But the way with nesting representing the document would be more like this!:

new css look would be like:
* { font-family: Verdana; font-size: 10pt; }   /* Standard font for all elements */

form.stlFormElement
{
    div
    {   color: red;

        span
        {
            label
            {
                margin-left: 10px;
                margin-right: 5px;
            }
            input
            {   font-weight: bold; }
        }
    }
    input
    {   padding: 5px; }
    span
    {   font-size: 8pt; }
}

Is this possible ? Would it be usefull (I think so) and if it would, could it be possible to use in the new css recc. ? :S

Many questions, few answers :) Hopefully some of you can help me :P

Robert de Wilde
wilde825@planet.nl

Received on Monday, 16 December 2002 09:55:27 UTC