[whatwg] several messages about <hr> and related subjects

Ian Hickson ian at hixie.ch
Wed Feb 20 17:57:02 PST 2008


Executive summary: no changes made; not much controversy.

On Sat, 21 May 2005, Rimantas Liubertas wrote:
> On 5/21/05, Ian Hickson <ian at hixie.ch> wrote:
> <...>
> >
> > Actually Steven Pemberton gave some interesting examples of what look 
> > to me like valid use cases for <hr/> in a recent talk of his. Search 
> > for <hr> in these slides:
> > 
> >    http://www.w3.org/2005/Talks/04-19-steven-XHTML2-XForms/
> > 
> > I don't really see what else to use for those.
> 
> I see no point for this even in this case. If you separate _sections_, 
> then they are already separate and you can style sections themself.
> 
> Example: http://rimantas.com/bits/hr/nohr.html
> 
> And if <hr> had any semantic meaning, then it was trasfered to class 
> attribute ;)

But this isn't necessarily separating sections (chapters). Look at any 
book of fiction -- there's definitely a level of separation that is 
between paragraphs that is within a section.

Indeed I wrote pretty much that before.

On Mon, 23 May 2005, Mikko Rantalainen wrote, in response to that:
> > 
> > They're not really sections. The chapter is the section, these are 
> > paragraphs together in the same chapter, with a divider between some 
> > of the paragraphs.
> > 
> > I read a lot of fiction books and when I come across a "* * *" it 
> > reads to me like a paragraph, saying "Meanwhile, in a different part 
> > of the universe:"; it doesn't read as "end section. new section:".
> 
> I read the "* * *" part exactly the same way. And I consider your quoted 
> text to be the header for that sub-section even though it's omitted from 
> the output. I feel that the correct markup to use would be
> 
> <section><!-- chapter starts here -->
> <h>Yet another chapter</h>
> <section><!-- 1st point of view, really a subsection -->
> <h class="undisclosed">In the Jack's basement</h>
> ...
> </section>
> <section><!-- presentation adds "* * *" here -->
> <h class="undisclosed">Meanwhile in the Bill's room</h>
> ...
> </section>
> </section><!-- chapter ends here -->

I don't think that's the structure. I think the structure is you have a 
section (a chapter) and it has paragraphs that are separated.


> In my opinion, this is the correct sematics for the content. To increase 
> excitement for the reader, some of the content is hidden during the 
> presentation. If you feel that hiding the information is part of the 
> semantics in this case (arguably that may be true), just drop all the 
> <h> elements with class "undisclosed" above.

I think this is trying to fit typical conventions on a mode of thinking 
that doesn't match the typical conventions. I don't think it's really a 
good abstraction to use.


> I think this is an example of why an <h> element shouldn't be required 
> inside a <section> element.

It's not.


> > To put it another way, sections are things that you can put a title 
> > to. There's no title you can put to a group of paragraphs separated 
> > from other groups of paragraphs in the same chapter of a work of 
> > fiction, in my experience. It's just the same chapter, with the 
> > narrative exploring different characters or scenes.
> 
> I think you can always put a title to a group of paragrahps. It's just 
> that sometimes (often?) you decide to leave it out for brevity / clarity 
> / excitement / whatever.

If you leave it out, it doesn't have a title.


On Thu, 2 Jun 2005, R.J.Koppes wrote:
>
> I too think <hr> carries semantics, although the tagname implies it's 
> fot presentaional use. things like <divider> or <seperator> sound more 
> reasonable I think

Too late for that! :-)


> I my opinion <hr> is a divider of content, it makes the content before 
> and after less bound than without. Speechbrowsers might pause here a 
> little longer, or play a tune like the ones you hear on the radio, 
> seperating news items.
> 
> I tend to put it between navigation and content, and between content and 
> some legal stuff at the bottom of the page. Since the seperation is in 
> many cases already evident, I often hide them, but in textbrowsers such 
> as lynx, I think it's function is quite clear.
> 
> When viewing for example my page without styles applied, I think the use 
> of <hr> makes sense.

I agree.


On Fri, 3 Jun 2005, Matthew Raymond wrote:
> 
>     So what you're saying is that if I want this...
> 
> | <section><!-- chapter starts here -->
> |  <h>Yet another chapter</h>
> |  <p>[Something about Jack.]</p>
> |  <hr>
> |  <p>[Something about Bill.]</p>
> | </section><!-- chapter ends here -->
> 
>     ...then I have to do this?...
> 
> CSS:
> | .chapter > section + section:before {
> |   content: "* * *";
> |   text-align: center;
> | }
> 
> HTML:
> | <section class="chapter"><!-- chapter starts here -->
> |  <h>Yet another chapter</h>
> |  <section><!-- 1st point of view, really a subsection -->
> |   <h class="undisclosed">In the Jack's basement</h>
> |   <p>[Something about Jack.]</p>
> |  </section>
> |  <section><!-- presentation adds "* * *" here -->
> |   <h class="undisclosed">Meanwhile in the Bill's room</h>
> |   <p>[Something about Bill.]</p>
> |  </section>
> | </section><!-- chapter ends here -->
> 
>     Actually, there are situations where the above would be suboptimal, 
> based on how :before and content are defined CSS2.1. For instance, if 
> you put a border around each <section>, the border would be rendered 
> around the "* * *".
> 
>     Note that if the above CSS is incorrect, it really just proves my 
> point: using CSS in place of <hr> is a pain for webmasters. Note also 
> that without CSS support (or if the separate CSS file isn't loaded for 
> some reason), you probably won't see a separator rendered unless that's 
> the default behavior for rendering sibling sections.
> 
>     This isn't just inconvenient from a styling and markup standpoint, 
> though, although clearly it increases the amount of HTML and CSS you 
> need. The big problem is that it places a semantic burden on authors 
> that currently doesn't exist in HTML. With current HTML, I just need to 
> put the paragraphs from the source text in <p> elements and use <hr> 
> where the source text has a visual separator. Doing away with <hr> means 
> at the very least that you're forced to put everything in <section> 
> elements when you previously didn't. Add to that the fact that authors 
> now have to know how to style the sections in order to get the separator 
> and you have a serious learning curve.

I agree.


> > I think you can always put a title to a group of paragrahps. It's just 
> > that sometimes (often?) you decide to leave it out for brevity / 
> > clarity / excitement / whatever.
> 
>    Decide to leave it out? You're assuming people even think of it in 
> terms of sections. We've gotten so used to narratives that cut from one 
> location to the next, or go back and forth between places or events or 
> characters, that we don't necessarily think of it in terms of different 
> sections. You're presuming that every time an author creates what could 
> be described as a section, it's done on purpose. In reality, it's may be 
> largely subconscious, and the author may not even think about it until 
> they need a separator.

I agree.


On Wed, 8 Jun 2005, Christoph Päper wrote:
> Ian Hickson:
> > On Mon, 23 May 2005, Christoph Päper wrote:
> > > 
> > >  <section>
> > >    <div class="pov Foo">...</div>
> > >    ...
> > 
> > ...has no semantics apart from delineating one section. Remember that 
> > class="" and <div> are meaningless. A document has the same semantics 
> > after you strip out any class attributes and <div> elements.
> 
> You say that and some others share that point of view, but I (and 
> probably others) disagree. It is true that 'div' or 'class' don't 
> provide semantics directly, but they do indirectly: Everything inside a 
> 'div' belongs together somehow and everything that shares a class 
> (inside a document instance) is related to each other somehow. You 
> cannot know /how/, but /that/.

My point was just that the above is equivalent to:

   <section>
     <div class="nohethinotehi">...</div>
     ...

...which is meaningless and for all practical purposes equivalent to:

   <section>
     ...
     ...

...except that there's a structural separation between the two sets of 
inline text here.


> If one doesn't like
> 
>   <section><div class="foo"><p/>+</div>+</section>
> 
> for the added level in the document tree, then he might use the semantically
> similar
> 
>   <section><p class="bar"/>+<p class="baz"/>+</section>.

...or:

   <section><p/>+<hr/><p/>+</section>


> All paragraphs that share a perspective or language or something are 
> logically linked, they belong to one group (or class) and maybe to 
> others, too. It can make sense to express this in mark-up. Then it's 
> easy (depending on your styling language of choice) to add visual (or 
> aural) clues to make the changes in perspective (or language) visible. 
> That doesn't have to be a more or less fancy rule or pause, but may be a 
> change in font, color, sound etc.

I agree it can be helpful to mark them, and you can use <div> for that. 
The point is that you don't _have_ to, you can use <hr>.


> > An <hr> is equivalent to a <p> with the content "Meanwhile, somewhere 
> > else..." or similar ("From someone else's point of view...", "At 
> > another time...").
> 
> No, it's not. You are connecting it with the succeeding element 
> instance, but it's not.
> 
> Anyhow, if it was, why wouldn't you use a 'p' with that content or an 
> empty one?

Convenience, clarity.


> >    <p><q>No!</q> said Fred.</p>
> >    <hr>
> >    <p>The tree stood alone.</p>
> > 
> >    +----------+ +--------------+-------+
> >    |  _____   | | Meanwhile... |       |
> >    | < No! >  | +--------------+       |
> >    |  \/^^^   | |         /|\          |
> >    |  o       | |         /|\          |
> >    | -+-      | |          |           |
> >    | / \      | |          |           |
> >    +----------+ +----------------------+
> > 
> > my point is that the <hr> here is a unit on par with a paragraph,
> 
> So why is it rendered embedded into the box of one of the paragraphs? 
> Shouldn't it be a child of it then?

That's what comics look like. It could easily be its own panel, it's just 
not the convention. (It's the comic equivalent of 'display: run-in'.)


> > If we didn't have <hr>,
> >    <p>* * *</p>
> 
> Or "<p/>" or "<p><img src="fancy-divider" alt="* * *"></p>".
>
> Does this provide the semantics? (IMHO it does not, because 'hr' or 
> 'plot' are one level higher than the 'p', but) if so, why should we 
> retain that limited 'hr' element type, which could ambiguously be in par 
> with other elements than 'p' (as in "</section><hr><section>")?

Why not include it? It's simple, it has a clear semantic, it's supported 
by browsers.


> > I really don't think:
> > 
> >     <p><q>No!</q> said Fred.</p>
> >    </plot>
> >    <plot>
> >     <p>The tree stood alone.</p>
> > 
> > ...would be better than <hr>,
> 
> I do. (Although I'm fine with using 'div' for this.)

I think that's excessive and unnecessary markup.


> > in fact I think it would be unnatural from an authoring perspective.
> 
> I, on the opposite, think that it's unnatural to mark the end of one 
> thing and the start of a second, but neither the start of the first nor 
> the end of the second. The reason you can do this in a printed work is, 
> that these are *implied* by chapter starts and ends. In SGML that 
> translates to something like (simplified)
> 
>   <!ELEMENT section - - (h?, (hr*|p*)) -- a chapter -->
>   <!ELEMENT hr      O O (p*)>
> 
> such that
> 
>   <section>
>     <h>Foo</h>
>       <p>Bar</p>
>     <hr>
>       <p>Baz</p>
>   </section>
> 
> generates this tree:
> 
>   section
>     h
>       "Foo"
>     hr
>       p
>         "Bar"
>     hr
>       p
>         "Baz"
> 
> (My DTD skills are rusting, but I think this magic is actually 
> possible.) XML DTDs are not that powerful, so we would have to rewrite 
> this to:
> 
>   <!ELEMENT section (h?, (hr*|p*))>
>   <!ELEMENT hr      (p*)>
> 
>   <section>
>     <h>Foo</h>
>     <hr>
>       <p>Bar</p>
>     </hr><hr>
>       <p>Baz</p>
>     </hr>
>   </section>
> 
> That's the same as above, just well-formed.

I think it is unrealistic to expect most authors to think this way.


> > We mustn't fall into the trap of considering everything to be a 
> > hierarchy, just because that is what XML most easily marks up.
> 
> I'm trying not to, but in all the alledged use cases that have presented 
> in favor of 'hr' or 'separator', I see a structure (or hierarchy), that 
> demands not a divider but a grouper.

I disagree that hierarchy need be the way we mark things up here.


> > Book authors have managed quite well for centuries without considering 
> > their documents to be formed of trees!
> 
> I don't think so. They're just not that much aware of it, they do it 
> subconsciously (at least the good ones).

If they're doing it subconsciously, they're not considering their 
documents to be formed of trees.


On Wed, 8 Jun 2005, Matthew Raymond wrote:
> 
>    The <div> (as well as <span>) does indeed have semantic meaning in 
> that it can group things. However, in the case of replacing <hr>, I 
> don't see how this semantic information can actually be used to benefit 
> the user. It's certainly useless on modern browsers from a presentation 
> standpoint if I turn CSS off.

Indeed.


>    By dropping <hr>, we're forcing a situation by which the web author 
> has to add structural markup that's of little or no use to him/her or 
> the user. In fact, I wouldn't be surprised if web authors deprived of an 
> <hr> element simply did this:
> 
> | <p>Paragraph 1</p>
> | <p class="hr">* * *</p>
> | <p>Paragraph 2</p>

True.


>    But creating sections in markup is NOT subconscious. I don't want to 
> spend hours pondering the structure of my novel. I just want a bloody 
> separator. If the structure of my writing wasn't important enough for me 
> to consider it on a conscious level, then why is it so important for it 
> to be in my HTML?

Indeed.


On Thu, 9 Jun 2005, Christoph Päper wrote:
> 
> Okay, with the goals of WHAT-WG and HTML5 it's maybe acceptable to 
> retain 'hr', but for XHTML2, which wants to make a clean re-start, this 
> unsemantic element type (under whatever name) must go.

That's not a concern for the WHATWG. :-)


> Yes. It's just like
> 
>   Foo
>   <br>
>   Bar
> 
> versus
> 
>     Foo
>   </p><p>
>     Bar.

The former would be the correct way to mark up an address or poem, though. 
Each line of an address or poem is not a separate paragraph, it's just a 
line.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'


More information about the whatwg mailing list