W3C home > Mailing lists > Public > www-html@w3.org > May 2003

Re: The style attribute, again

From: Andy <aholmes84@shaw.ca>
Date: Mon, 12 May 2003 12:22:56 -0700
To: "Peter Foti (PeterF)" <PeterF@SystolicNetworks.com>, www-html@w3.org
Message-id: <3EBFF490.4070703@shaw.ca>

Peter Foti (PeterF) wrote:

>My thought on the subject was that there should be a STYLE element allowed
>within the body of a document that could be applied to a certain scope.
>Perhaps a STYLE tag with an attribute that signifies an IDREF that
>identifies the container where the style should be applied.  For example:
>   <div class="b">
>      No styles here.
>   </div>
>   <style scope="imported">
>   .b { font-weight: bold; }
>   </style>
>   <div id="imported">
>      This text was <span class="b">imported</span>.
>   </div>
>Or perhaps some method of using namespaces to siginify where the style
>should be applied.  I never really put much thought into it, and no one
>seemed to take much notice when I suggested it.
I must disagree. Using inline style just creates too many unnecessary 
problems, many of which are outlined in 

Your example causes conflictions as well using the 'id' attribute to 
apply your style, in addition to the fact that the style attribute is 
only allowed in the 'head' element. The obvious solution to the above 
problem is to simple use a different class name such as 'imported-b' or 
a selector such as:

    div#imported span.b {
       font-weight: bold;

Selectors like this have been present in CSS since CSS1. CSS2 and CSS3 
(will) expand greatly upon selectors' "accuracy".

Received on Monday, 12 May 2003 15:25:22 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:06:03 UTC