|
Posted by City Dweller on 10/23/83 11:56
I beg to differ on that one. Rule 5 should only be applied if the
specificity is the same and it isn't.
I did some more research on it. As it turned out, all major browsers
adopted a modified version of the CSS specs where the STYLE properties
are given the number 1000, thus taking them above all other external
rules.
Thanks again for replying.
-- CD
David Woods wrote:
> "City Dweller" <dc_dweller@hotmail.com> wrote in message
> news:1156537854.918744.55750@m79g2000cwm.googlegroups.com...
> > David,
> >
> > Thanks for responding.
> >
> > That is not what CSS specs say, though. Here is quote from
> > http://www.w3.org/TR/REC-CSS1:
> >
> > <<QUOTE>>
> > A declaration in the 'STYLE' attribute of an element has the same
> > weight as a declaration with an ID-based selector that is specified at
> > the end of the style sheet:
> >
> > <STYLE TYPE="text/css">
> > #x97z { color: blue }
> > </STYLE>
> >
> > <P ID=x97z STYLE="color: red">
> >
> > In the above example, the color of the 'P' element would be red.
> > Although the specificity is the same for both declarations, the
> > declaration in the 'STYLE' attribute will override the one in the
> > 'STYLE' element because of cascading rule number 5.
> > <<END OF QUOTE>>
>
> You need to refer to rule #5 specified above the part you quoted.
>
> [quote]
> 5. Sort by order specified: if two rules have the same weight, the latter
> specified wins. Rules in imported style sheets are considered to be before
> any rules in the style sheet itself.
> [/quote]
>
> x97z is specified in the internal style sheet which is BEFORE the inline
> style has been specified. Therefore, the inline style wins.
>
>
> --
>
> David
Navigation:
[Reply to this message]
|