Re: Horizontal rules

>From Matthew Brealey
>Date: Tue, Feb 29, 2000, 11:28 AM

> Here's HTML's HR implementation (as implemented by Win IE  and Opera)

Per the HR discussion in general, even though HR itself can be considered a
block for formatting purposes, the point of where the "rule" of the Horizontal
Rule element draws needs to act like an auto-sized contained glyph that
formats more like a horizontally stretched text character rather than a border
(as described by others).  E.g. it *does not* draw or get sized under adjacent
floats - it draws in the area that text in a similarly placed box would flow
into.  And it is sized (%) and aligned within that flow area as well.

This behavior is both as implemented by current UAs, and what is more visually
desirable.

It is an error to attempt to sacrifice the visually desirable rendering to a
set of rules that don't adequately describe it.

Yes, we don't have what would be necessary in CSS to properly describe the
typical and desirable rendering of <HR>.  Some additional concepts are
necessary.

That being said:

> completely described in CSS3:

Untrue.  There are aspects in this style sheet which are not valid features in
any CSS Rec or public WD.

> HR {border: 1px solid;
> border-color: windowborder /* ? */;
> display: block;
> margin: 6px auto}
>
> HR[color] {border-color: attr(color)}

Strictly speaking, the COLOR attribute of HR and the CSS color property do not
accept the same set of values, and the border-color property in particular
does not accept 'attr()' as a value.

> HR[align=left] {margin-left: 0 !important /* In a UA style sheet? (used
> because the author might set margins, which would override this
> declaration. I believe a UA !important is essential if there is a real
> desire to map HTML attributes to CSS, and I suggest that it raise the UA
> declaration to an author one; i.e., this declaration is equivalent to
> setting margin-left: 0 in an author style sheet, so specificity works
> properly */}
>
> HR[align=right] {margin-right: 0 !important}
>
> HR[size] {height: attr(size)-1} /* Sad that even box-sizing doesn't work
> for this (since the default, size=1 has a box height of 2 pixels (top and
> bottom borders of 1pixel) */

height: attr(size) is incorrect because unitless length values for height are
illegal (typical use of the SIZE attribute is unitless).  in addition, the
height property in particular does not accept 'attr()' as a value.

attr(size)-1 is undefined because there are no binary arithmetic operators
allowed in CSS length values.

> HR[noshade] {background: windowborder}
>
> HR[noshade][color] {background: attr(color)}

Similarly to the HR[color] rule above, the COLOR attribute of HR and the CSS
background-color property do not accept the same set of values, and the
background-color property in particular does not accept 'attr()' as a value.

Tantek

Received on Tuesday, 29 February 2000 14:52:09 UTC