[whatwg] level attribute

juanrgonzaleza at canonicalscience.com juanrgonzaleza at canonicalscience.com
Fri Aug 4 00:30:23 PDT 2006


Jonathan Worent said:
>
> I have just recently become interested in the work WHATWG is doing. I
> apologize if something like this has already been suggested.
>
> I'd like to suggest adding a level attribute to both em and strong tags.
> This attribute would be used to set the level of emphasis/importance,
> rather than by nesting. The level attribute would take a negative
> integer, to indicate, de-emphasis/less importance, a positive integer,
> to indicate increasing emphasis/importance, or a "0", to indicate the
> default. If the default is desired the level attribute could be left
> off, unless it is nested within an element that has changed the level
> (though I can't think of any examples where this would be good
> practice). There would need to be a reasonable limit for the number of
> levels, both positively and negatively
>
>     Examples:
>         <em level="2">I am getting <em level="3">very</em> angry.</em>

This remember me the highlight tag of some markup language.

>         I don't spend every waking moment on the computer, <strong
> level="-1">although my wife thinks otherwise</strong>.
>
>         <strong level="1">This is a bad example of where the <strong
> level="0">default level</strong> has to be explicit
> stated.</strong>
>
> I think a level attribute is better than nesting because it allows for
> reducing the emphasis/importance below  normal. Nesting can only
> increase this.

Not necesarily.

<em>level-1<em>level-2</em></em>

<em class="dem">level-2<em class="dem">level-1</em></em>

define proper CSS rules for <em class="dem">

but more natural appears to be changing the markup for deemphasizing.

<em><em>level-2</em><em>level-1</em>

> A use-case where de-emphasis would be needed is in marking up a
> transcript. (WCAG requires this for accessibility) De-emphasis could be
> used to indicate that the speaker whispered.
>
> A use-case where indicating less importance would be needed would be
> digression. This is different than aside IMHO.
>
> I understand that this is not backwards compatible. But, IMHO, neither
> is nesting elements. Future browsers already will have to change to
> understand that nesting em or strong increases emphasis/importance. They
> could also be changed to understand the level attribute.
>
> If this cannot be done then I would suggest as an alternative: Add 2 new
> elements. One for indicating de-emphasis, One of indicating less
> importance. I leave the naming of them to you.

The advantage of nesting and reason for the new heading model of XHTML2 is
in that you do not need be aware of structure at each instant. Absolute
levels h1, h2, h3... are to be avoided in next XHTML2. Why would we
reintroduce it in <em> and <strong> now?

I also find problems with CSS and definition of levels. Is level="2"
absolute, i.e. independent of position of <em>, or relative, i.e.
level="2" over level="0" defined by container?

> Thank you,
> Jonathan
>


Juan R.

Center for CANONICAL |SCIENCE)





More information about the whatwg mailing list