W3C home > Mailing lists > Public > www-style@w3.org > August 1996

Style attribute on element == ID?

From: Hakon Lie <howcome@w3.org>
Date: Wed, 28 Aug 1996 23:50:48 +0200
Message-Id: <199608282150.XAA28136@www4.inria.fr>
To: "Galarneau, Neil" <ngalarneau@concord6.powersoft.com>
Cc: "'www-style'" <www-style@w3.org>
Neil Galarneau writes:

 > Is a style attribute on an HTML element equivalent in weight to an
 > ID on that element?

The CSS1 spec [1] says:

 "A 'STYLE' attribute on an element (see section 1.1 for an example)
  should be considered as if an ID attribute had been specified at the
  end of the style sheet."

If two declarations have the same weight, the latter specified will
override the first one (cascading rule #5). Therefore, the STYLE
attribute will override a declaration with an ID-based selector.

So, STYLE wins.

-h&kon

Hakon W Lie, W3C/INRIA, Sophia-Antipolis, France
http://www.w3.org/people/howcome  howcome@w3.org
Received on Wednesday, 28 August 1996 17:54:29 GMT

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