-3

Example ...

HTML:

    <hgroup>
      <h1>I'm a Title!</h1>
      <p class="sh1">It's a subtitle there! :D</p>
    </hgroup>

CSS: There I set the styles for headings and subheadings. Note that html5 doesn't support subheadings, so I had the following idea with classes..

    h1 { font-size: 2em; } /* default */
    h2 { font-size: 1.5em; } /* default */
    h3 { font-size: 1.17em; } /* default */ /* default for h4 is .83em; */

    :root {
        --sh1: 1.75em; /* subheading text size for h1. */
        --sh2: 1.335em; /* subheading text size for h2. */
        --sh3: 1em; /* subheading for text size h3. */
    }

    p .sh1 { font-size: var(--sh1); } /* shn means subheading */
    p .sh2 { font-size: var(--sh2); } /* it would work like <hn> tag */
    p .sh3 { font-size: var(--sh3); } /* it would be great to have <shn> */

So, my question is ...

As you may know, w3c actually doesn't support hgroup tags, because they were irrelevant. They used to contain several hn headings, and that was considered a bad idea and didn't pass through the w3c recommendation system.

Therefore, my idea is ...

Instead of being a simple container for several hn headings, it would be nice to use hgroup tags to enclose each hn headings alongside shn subheadings right inside that same hgroup! =D

Edit: This is not about asking the w3c to change how the hgroup works, is about asking you if my idea is markup-reliable and respects the w3c system My bad

  • This question seems to be about how to organise a social movement to petition for change; that - despite the subject of that desired change - does not make this a programming question. Incidentally, don't add your 'tags' to your signature; we have question tags already. Duplicating them as text within the question provides no help to anyone and obscures the question you're (trying) to ask. – David Thomas Jul 05 '18 at 13:32
  • I'm voting to close this question as off-topic because it's not a programming question, but seems instead to be a question about how a group of people could be motivated to petition for change. – David Thomas Jul 05 '18 at 13:33
  • what is it about the `
    `tag ??
    – G-Cyrillus Jul 05 '18 at 13:41
  • @G-Cyr I was using `

    ` for subheadings of the `

    ` headings, and then I realised that was a bad habit. So I had the idea of creating the classes `.sh1` for `

    ` elements, meaning subheader for `

    `. Then I asked a petition for w3c but I didn't mean this post is about making a social movement to petition for change, I meant if it was correct to use my idea and if it did respect markup syntax logic.

    –  Jul 05 '18 at 14:07
  • @David Thomas the point on including the tags inside the question's last line is because the `hgroup` and `subheading` tags did not exist. And I did need to have at least 1500 reputation points to create a new tag. By the way, I won't insert the tags into the question once ever again, but I still think that it should be not forbidden. –  Jul 05 '18 at 14:14
  • I was asking about `
    `, because it is a typical use for it
    – G-Cyrillus Jul 05 '18 at 14:14
  • @G-Cyr ah, no. I talk about headings (`h1`), not `header` tags hehe –  Jul 05 '18 at 14:27
  • 1
    `hgroup` is still [partially implemented](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/hgroup) (see "Usage Notes") in most browsers, so repurposing it on your own initiative is probably not a great idea. Meanwhile your use of `

    ` tags as subheads is *clearly* semantically incorrect; use real header tags, or at least include an ARIA heading role.

    – Daniel Beck Jul 05 '18 at 14:33
  • also, since an `hgroup` has not sematic relevance, why not just use a `div` instead? What **extra** does using an `hgroup` get you? – Paulie_D Jul 05 '18 at 14:37
  • I didn't mean to repurposing it on my own initiative, that is why I ask the question, because I didn't knew if I was being semantically correct or not. Then that answers my question, thanks @Daniel Beck and Paulie_D ;) I will try out using divs and ARIA. –  Jul 05 '18 at 14:43
  • By the way, which element should I use to identify the subheading? `

    `? <`span`>? thanks for your attention.

    –  Jul 05 '18 at 15:43
  • `h1` through `h6` tags are for headings. `p` is for paragraphs, `span` is for inline elements. The names of the tags are pretty self-explanatory about their purpose. – Daniel Beck Jul 06 '18 at 23:19
  • @Daniel Beck: That's actually only true in the living spec. W3C HTML5(.2) [*does* forbid the use of h1-h6 and require the use of p to mark up subtitles due to its omission of the hgroup element](https://www.w3.org/TR/html52/common-idioms-without-dedicated-elements.html#common-idioms-without-dedicated-elements), and it's been this way ever since the HTMLWG dropped hgroup from their spec a number of years ago. This then boils down to whether the author wants to follow WHATWG HTML or W3C HTML5. – BoltClock Jul 09 '18 at 04:28
  • I learned something new today. Thanks @BoltClock – Daniel Beck Jul 09 '18 at 12:27
  • Thanks for your answer @BoltClock =) you just could fix my dilema finally xD –  Jul 19 '18 at 17:37

1 Answers1

1

What you propose is part of how the hgroup element was defined to work in previous W3C HTML5 drafts, and how it still is in the current WHATWG living spec. (In fact, your markup conforms fully to WHATWG HTML.)

Except hgroup is no longer in W3C HTML5, and hasn't been for a few years with seemingly no plans of being reinstated. If you want to follow W3C HTML5, you simply aren't allowed to use hgroup at all.

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356