RE: Alternatives to 'style' attribute?

What about some form of scoped style sheets, where the style rules only
apply to the elements that are within the scope of the style definitions?
For example:

<div id="toplevel">
   <style>
      #toplevel
      {
         color: black;
         font-family: arial, sans-serif;
      }
   </style>
   <p>This is black arial</p>
   <div>
      <style>
         #toplevel
         {
            color: white;
            font-family: times, serif;
         }
         
         p
         {
            color: red;
         }
      </style>
      This is black arial because the style
      for white times was applied to id toplevel,
      which is out of scope.
      <p>This is red arial.</p>
   </div>
   <p>This is black arial.</p>
</div>


Of course, this approach is not backwards compatible because the style that
usually goes in the <head> would be out of scope... and of course, doesn't
address issues of repeating ID values.  I'm just throwing the idea out
there.  :)

Peter



> -----Original Message-----
> From: www-html-request@w3.org 
> [mailto:www-html-request@w3.org]On Behalf
> Of Micah Dubinko
> Sent: Wednesday, January 15, 2003 4:24 PM
> To: 'Boris Zbarsky'; Mikko Rantalainen
> Cc: Daniel Glazman; www-html@w3.org
> Subject: Alternatives to 'style' attribute?
> 
> 
> 
> Hi everybody,
> 
> The flawed assumption in this argument is that the only 
> choices are to have
> a 'style' attribute or not. There are many other 
> possibilities, for instance
> <style> elements allowed outside the head, nesting, etc.
> 
> Couldn't we brainstorm on some other alternatives? Binary 
> choices are so
> limiting! :-)
> 
> .micah
> 
> -----Original Message-----
> From: Boris Zbarsky [mailto:bzbarsky@MIT.EDU]
> Sent: Wednesday, January 15, 2003 11:04 AM
> To: Mikko Rantalainen
> Cc: Daniel Glazman; www-html@w3.org
> Subject: Re: XHTML 2.0 considered harmful
> 
> 
> 
> > You cannot copy and paste *content with the styling 
> information only* if 
> > the target medium is sematic one, like (X)HTML. Period.
> 
> While this may be what you would like to be the case, in the 
> real world (of
> wysiwyg HTML editors, which you probably think cannot exist 
> either) this
> situation is not necessarily acceptable.  You _do_ want to be 
> able to copy a
> paragraph out of an HTML e-mail and into a document you're writing and
> (optionally) preserve the style.
> 
> Boris
> -- 
> Windows 95:
>    (noun): 32 bit extensions and a graphical shell for
> a 16 bit patch to an 8 bit operating system originally
> coded for a 4 bit microprocessor, written by a 2 bit
> company, that can't stand 1 bit of competition.
> 

Received on Wednesday, 15 January 2003 17:19:58 UTC