Re: About dropping the style attribute

You may find "scoped style" does some of what you need from a style
attribute...?
http://dev.w3.org/cvsweb/~checkout~/html5/spec/Overview.html#the-style


On 6/24/07, Craig Francis <craig@synergycms.com> wrote:
>
> On 23 Jun 2007, at 23:25, Alfonso Martínez de Lizarrondo wrote:
> > I've realized now that the current spec drops the style attribute for
> > all elements except for the <font>, but I can't understand the
> > reasoning behind those decisions.
>
>
> Bimly I missed that one when reading the differences from HTML4
> document!
>
> Considering that most CSS files are not generated by a server side
> scripting/programming language, how would you generate dynamic styles
> without the @style attribute?
>
> I have done a couple of websites where flat CSS files have been used
> to create the overall look and feel of the website, but the odd rule
> is tweaked in the HTML, which has been generated by PHP.
>
> A site I was working on a while back faded the background colour from
> black to white depending on the time of day... taking that the CSS
> files are cached, it made sense to add a @style attribute on the
> <body> tag to set the background colour... do I take it that I will
> now need to add 100 or so classed to a pre-made style sheet, and then
> set the class on the body tag?
>
> As another example, we had a 1000+ page website... the headings had
> to use a special font, so we created the usual <h1> tags, with the
> text, and set the background-image though the @style attribute on
> each page individually... all other rules relating to the heading
> were in the external style sheet... so does that mean we have to
> create thousands of classes as well?
>
> Personally I would prefer that we ditched the <font> tag before we
> lost the @style attribute...
>
> I would have thought that anyone who knows how to use the @style
> attribute will know about external style sheets, and therefore know
> that they should be used to hold most of the rules.
>
> Craig
>
>

Received on Sunday, 24 June 2007 04:10:27 UTC