W3C home > Mailing lists > Public > public-html@w3.org > July 2007

Re: Wiki page for style attribute

From: Rene Saarsoo <nene@triin.net>
Date: Thu, 05 Jul 2007 22:08:19 +0300
To: "Thomas Broyer" <t.broyer@gmail.com>, public-html@w3.org
Message-ID: <op.tuz935gkexn25i@localhost>

Thomas Broyer wrote:
> I've added a few cons to some proposals:
> http://esw.w3.org/topic/HTML/StyleAttribute?action=diff&rev2=30&rev1=29

Great! Some thoughts about some of those additions:

> <font style=""> with WYSIWYG signature
>
> * Does not allow styling of replaced content (e.g. size of image, but
>   there are width= and height= attributes already) or non-inherited
>   style properties (e.g. borders)

I didn't really understood, what was the exact problem with
replaced content that you tried to express, but I completely
agree with the latter part of your statement:

   <font style=""> does not allow styling of non-inherited style
   properties.

For example, you can't use it to remove margins from heading:

   <font style="margin:0">
     <h1>My heading</h1>
   </font>

Doesn't work at all. Meaning, that the <font style="">-solution
is actually disfunctional.


> <style scoped>
> <localstyle> element
>
> * Does not allow styling of void elements

That's not really correct. It *does* allow styling of void elements:

<article>
   <style scoped> img {border: none} </style>
   <p><a href=""><img src="foo" alt="bar"></a></p>
</article>

I guess what you really mean, is that you can't put scoped
style element inside a void element, to apply styles just for
that element.

Actually, according to current draft, you can only place
scoped styles inside article, aside, div, or section element,
which is quite limiting.

For example when I quote some text from another site, I may
want to style it exactly the same way, as it is on that
external site. So it makes perfectly sense to put <style scoped>
inside <blockquote>. According to draft I would have to wrap
it inside additional <div> - doesn't make sense to me.

I think it should be allowed inside almost all elements,
because when user-agents implement <style scoped> then they
also have to consider the situation where <style scoped> is
inside some other element. Possible solutions are:

  - Ignore all styles in it.
  - Apply styles globally instead.
  - Apply styles to the ancestor article, aside, div or section element.
  - Apply styles to the element, although a wrong one.

The latter seems to be the most intuitive - because, that's
what the author probably intended.

--
Rene Saarsoo
Received on Thursday, 5 July 2007 19:08:59 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:16:02 GMT