Short note on wearing shorts
A fellow traveller posed an interesting question: Why do you wear shorts rather than longs? The short answer is that I enjoy wearing shorts, the long answer is...
body elementonafterprintonbeforeprintonbeforeunloadonhashchangeonlanguagechangeonmessageonofflineononlineonpagehideonpageshowonpopstateonrejectionhandledonstorageonunhandledrejectiononunloaddocument role (default - do not set).
aria-* attributes applicable to the default role.
interface HTMLBodyElement : HTMLElement {
};
HTMLBodyElement implements WindowEventHandlers;
document.body IDL attribute provides scripts with easy access to a document's
<{body}> element.
Some DOM operations (for example, parts of the drag and drop model) are defined in terms
of "the body element". This refers to a particular element in the DOM, as per the
definition of the term, and not any arbitrary <{body}> element.
Window object. It also mirrors their
event handler IDL attributes.
The onblur, onerror, onfocus, onload,
onresize, and onscroll event handlers of the Window
object, exposed on the <{body}> element, replace the generic event handlers with
the same names normally supported by HTML elements.
Thus, for example, a bubbling error event dispatched on a child of
the body element of a {{Document}} would first trigger the onerror
event handler content attributes of that element, then that of the root <{html}>
element, and only then would it trigger the onerror event handler
content attribute on the <{body}> element. This is because the event would bubble
from the target, to the <{body}>, to the <{html}>, to the
{{Document}}, to the {{Window}}, and the event handler on the
<{body}> is watching the Window not the <{body}>. A regular event
listener attached to the <{body}> using addEventListener(), however, would
be run when the event bubbled through the body and not when it reaches the
Window object.
You are: (Unknown)
article elementarticle (default - do not set),
application,
document,
feed,
main,
none,
presentation
or
region.
aria-* attributes applicable to the allowed roles.
Assistive Technology may convey the semantics of the <{article}> to users. This
information can provide a hint to users as to the type of content. For example the
role of the element, which in this case matches the element name "article",
can be announced by screen reader software when a user navigates to an <{article}> element.
User Agents may also provide methods to navigate to <{article}> elements.
article. For instance, an article
may consist of a <{header}> that contains the primary heading of the article,
with other elements to provide lead-in or meta content about the article prose.
Additionally, an article may consist of various subsections that, together, form the complete
composition. These subsections may be implied by the use of appropriately ranked headings
(<{h1}>-<{h6}> elements), or may be explicitly set by use of a <{section}> element or elements.
When <{article}> elements are nested, the inner <{article}> elements represent articles that
are in principle related to the contents of the outer article. For instance, a blog entry on a
site could consist of summaries of other blog entries in <{article}> elements nested within
the <{article}> element for the blog entry.
The following is an example of a blog post extract, marked up using the <{article}> element:
A fellow traveller posed an interesting question: Why do you wear shorts rather than longs? The short answer is that I enjoy wearing shorts, the long answer is...
The schema.org vocabulary can be used to provide more granular information about the type of article, using the CreativeWork - Article subtypes, other information such as the publication date for the article can also be provided.
Always check that your computer is plugged in before you complain it isn't working.
Always check that your computer is plugged in before you complain it isn't working.
Posted by: George Washington
Yeah! I've done that!
Posted by: George Hammond
Hey, you have the same first name as me.
Notice the use of an ordered list (ol element) to organize the comments.
Also note these comments are considered a subsection of the article, identified
by the section element they are nested within.
section elementregion role (default - do not set),
alert,
alertdialog,
application,
banner,
complementary,
contentinfo,
dialog,
document,
feed,
log,
main,
marquee,
navigation,
none,
presentation,
search,
status
or
tabpanel.
aria-* attributes
applicable to the allowed roles.doc-abstract,
doc-acknowledgments,
doc-afterword,
doc-appendix,
doc-bibliography,
doc-chapter,
doc-colophon,
doc-conclusion,
doc-credit,
doc-credits,
doc-dedication,
doc-endnotes,
doc-epilogue,
doc-errata,
doc-example,
doc-foreword,
doc-index,
doc-introduction,
doc-notice,
doc-pagelist,
doc-part,
doc-preface,
doc-prologue,
doc-pullquote,
doc-qna
or
doc-toc
section should
be identified, typically by including a heading (h1-h6 element) as a
child of the <{section}> element.
Examples of sections would be chapters, the various tabbed pages in a tabbed dialog box, or the numbered sections of a thesis. A Web site's home page could be split into sections for an introduction, news items, and contact information.
Unlike an <{article}>, a <{section}> may not be fully understandable if taken out of context of its originating document or application. Authors are encouraged to use the <{article}> element instead of the <{section}> element when the content is a complete, or self-contained, composition.
While the <{section}> element represents a generic section of a document or application, it is not a generic container element. When a wrapping element is needed for styling purposes, or as a convenience for scripting, authors are encouraged to use the <{div}> element instead. A general rule is that the <{section}> element is appropriate only if the element's contents would be listed explicitly in the document's outline.
Assistive Technology may convey the semantics of the <{section}> to users when the element has
an explicit label. This information can provide a hint to users as to the type of content.
For example the role of the element, which in this case is "region", can be
announced by screen reader software when a user navigates to an <{section}> element.
User Agents may also provide methods to navigate to <{section}> elements.
The <{section}> has an <{aria/aria-label}> attribute providing a brief description of the
contents. Assistive technology may convey the
region role along with the <{aria/aria-label}>
value as a hint to users.
Tasty, delicious fruit!
The apple is the pomaceous fruit of the apple tree.
These bright red apples are found in many supermarkets.
These juicy, green apples make a great filling for apple pies.
section there could
exist articles, providing brief bios, academic achievements, and personal
note from the graduates.
Opening Procession
Speech by Valedictorian
Speech by Class President
Presentation of Diplomas
Closing Speech by Headmaster
Molly was valedictorian of her class, graduating with a GPA of...
A sample with not much content
Published by Example Publishing.
This is the first of my chapters. It doesn't say much.
But it has two paragraphs!
Bla dee bla, dee bla dee bla. Boom.
It's not like a battle between brightness and earthtones would go unnoticed.
But it might ruin my story.
These are demonstrations.
Hopefully this long example shows that you can style sections, so long as they are used to indicate actual sections.
nav elementnavigation role (default - do not set).
aria-* attributes
applicable to the default role.doc-index,
doc-pagelist
or
doc-toc
Assistive Technology may convey the semantics of the <{nav}> to users. This information can
provide a hint to users as to the type of content. For example the role of the
element, which in this case is "navigation", can be announced by screen reader software when
a user navigates to an <{nav}> element. User Agents may also provide methods to navigate to
<{nav}> elements.
In cases where the content of a <{nav}> element represents a list of items, use list markup to aid understanding and navigation.
Not all groups of links on a page need to be in a <{nav}> element — the element is primarily intended for sections that consist of major navigation blocks. In particular, it is common for footers to have a short list of links to various pages of a site, such as the terms of service, the home page, and a copyright page. The <{footer}> element alone is sufficient for such cases; while a <{nav}> element can be used in such cases, it is usually unnecessary.
User agents (such as screen readers) that are targeted at users who can benefit from navigation information being omitted in the initial rendering, or who can benefit from navigation information being immediately available, can use this element as a way to determine what content on the page to initially skip or provide on request (or both).
Written by A. N. Other.
Last Modified: 2009-04-01
Today I went to the beach and had a lot of fun.
...aside elementcomplementary role (default - do not set),
feed,
note,
presentation,
none,
region
or
search
aria-* attributes applicable to the allowed roles.doc-example,
doc-footnote,
doc-pullquote
or
doc-tip
role of
the element, which in this case is "complementary", can be announced by screen reader software
when a user navigates to an <{aside}> element. User Agents may also provide methods to navigate
to <{aside}> elements.
It's not appropriate to use the <{aside}> element just for parentheticals, since those are part of the main flow of the document.
She later joined a large company, continuing on the same work.
I love my job. People ask me what I do for fun when I'm not at work. But I'm paid to do my hobby, so I never know what to answer. Some people wonder what they would do if they didn't have to work... but I know what I would do, because I was unemployed for a year, and I filled that time doing exactly what I do now.
Of course her work — or should that be hobby? — isn't her only passion. She also enjoys other pleasures.
...This is my last post.
This is my first post.
h1, h2,
h3, h4,
h5, and h6
elements
heading role (default - do not set),
none,
presentation
or
tab
aria-* attributes
applicable to the allowed roles.
interface HTMLHeadingElement : HTMLElement {};
doc-subtitle
h1
element has the highest rank, the h6 element has the lowest rank, and two
elements with the same name have equal rank.
Use the rank of heading elements to create the document outline.
The document outline would be the same if the <{section}> elements were not used.
h1–h6 elements must not be used to markup subheadings, subtitles,
alternative titles and taglines unless intended to be the heading for a new section or
subsection.
Instead use the markup patterns in the [[#common-idioms-without-dedicated-elements]] section of
the specification.
Assistive technology often announces the presence and level of a heading to users, as a hint
to understand the structure of a document and construct a 'mental model' of its outline.
For example the role of the element, which in this case is "heading" and the
heading level "1" to "6", can be announced by screen reader software when a user navigates to
an h1–h6 element. User Agents may also provide methods to navigate to
h1–h6 elements.
The semantics and meaning of the h1–h6 elements are further
detailed in the section on [[#headings-and-sections]].
header elementbanner role (default - do not set),
group,
none
or
presentation
aria-* attributes
applicable to the allowed roles.
doc-footnote
banner", can be announced
by screen reader software when a user navigates to a <{header}> element that is scoped to the
<{body}> element. User Agents may also provide methods to navigate to a <{header}> element
scoped to the <{body}> element.
A <{header}> element is intended to usually contain the section's heading
(an h1–h6 element), but this is not required. The <{header}> element
can also be used to wrap a section's table of contents, a search form, or any relevant logos.
W3C Working Draft 27 October 2004
Hello world!
A primer on getting rich quick, while avoiding making horrible promises.
...header is now
appropriately scoped to a subsection of the article:
<article>
<header>
<h2>Spinning Straw into Gold</h2>
<p>A primer on getting rich quick, while avoiding making horrible promises.</p>
</header>
This text will guide you through the necessary steps to complete this impossible task...
<section>
<header>
<h3>Make a point to learn obscure names</h3>
</header>
If you are tasked with guessing someone's name, then it should be safe to assume that common names won't get you far...
</section>
</article>
The <{header}> element is not sectioning content; it doesn't introduce a new section,
though headings within a header will indicate new sections to the page.
To play today's games you will need to update your client.
You have three active games:
...
For cases where a developer wants to nest a header or footer within
another header: The <{header}> element can only contain a <{header}> or <{footer}>
if they are themselves contained within sectioning content.
In this example, the <{article}> has a <{header}> which contains an <{aside}> which itself
contains a header. This is conforming as the descendant header
is contained within the aside element.
The guide about Flexbox was supposed to be here, but it turned out Wes wasn't a Flexbox expert either.
footer elementcontentinfo role (default - do not set),
group,
none or
presentation.
: [=Allowed ARIA state and property attributes=]:
:: [=Global aria-* attributes=]
:: Any <{aria/aria-*}> attributes
[[#allowed-aria-roles-states-and-properties|applicable to the allowed roles]].
: [=DOM interface=]:
:: Uses {{HTMLElement}}.
: DPub Roles:
:: doc-footnote
Contact information for the author or editor of a section belongs in an <{address}> element, possibly itself inside a <{footer}>. Bylines and other information that could be suitable for both a <{header}> or a <{footer}> can be placed in either (or neither).
Footers don't necessarily have to appear at the end of a section, though they usually do.The <{footer}> element is not sectioning content; it doesn't introduce a new section.
This is an example
Some text explaining the example...
I love my trains. My favorite train of all time is a Köf.
It is fun to see them pull some coal cars because they look so dwarfed in comparison.
h1–h6 elements are headings.
The first element of heading content in an element of sectioning content
represents the heading for that explicit section. Subsequent headings of equal or higher
rank start new implied subsections that are part of the previous section's parent
section. Subsequent headings of lower rank start new implied subsections that are part
of the previous one. In both cases, the element represents the heading of the implied
section.
h1–h6 elements must not be used to markup subheadings, subtitles,
alternative titles and taglines unless intended to be the heading for a new section or
subsection. Instead use the markup patterns in the [[#common-idioms-without-dedicated-elements]]
section of the specification.
Certain elements are said to be sectioning roots, including blockquote
and <{td}> elements. These elements can have their own outlines, but the sections and
headings inside these elements do not contribute to the outlines of their ancestors.
Bla
Baz
Grunt
body section, containing the "Grunt" paragraph)
1. Bar (heading starting implied section, containing a block quote and the "Baz" paragraph)
2. Quux (heading starting implied section with no content other than the heading itself)
3. Thud (heading of explicit section section)
Notice how the section ends the earlier implicit section so that a later paragraph
("Grunt") is back at the top level.
Apples are fruit.
They taste lovely.
Red apples are sweeter than green ones.
Apples come in various colors.
Apples are fruit.
They taste lovely.
Red apples are sweeter than green ones.
Apples come in various colors.
There are currently no known native implementations of the outline algorithm in graphical
browsers or assistive technology user agents, although the algorithm is implemented in other
software such as conformance checkers and browser extensions. Additionally, there is an
alternate outline algorithm proposal
being developed, as well as proposals to modify the existing algorithm
(See W3C HTML issue #1005 and
W3C HTML issue #830).
Any implementation and usage of these different proposals will be tracked, and may result
in significant future changes to the outline algorithm.
Therefore, the outline algorithm cannot be relied upon to convey document structure
to users. Authors should use heading rank (h1-h6) to
convey document structure.
This section is non-normative
This section defines an algorithm for creating an outline for a sectioning content element or a sectioning root element. It is defined in terms of a walk over the nodes of a DOM tree, in tree order, with each node being visited when it is entered and when it is exited during the walk. Each time a node is visited, it can be seen as triggering an enter or exit event.
visitNode(node)
onEnter(node)
child = node.firstChild
while(child != null)
visitNode(child)
child = child.nextSibling
onExit(node)
...exemplifies how to recursively traverse the node tree and when to trigger the enter
and exit events.
See the JavaScript example for a possible,
non-recursive JavaScript implementation.
B
D
F
body node (and thus the
entire document):
1. Section created for body node. Associated with heading "A". Also associated
with paragraph "B". Nested sections:
1. Section implied for first h2 element. Associated with heading "C". Also
associated with paragraph "D". No nested sections.
2. Section implied for second h2 element. Associated with heading "E". Also
associated with paragraph "F". No nested sections.
The element being exited is a heading content element or an element with a <{global/hidden}> attribute.
Pop that element from the stack.The current outline owner is the element being exited, and it is the sectioning content element or a sectioning root element at the root of the subtree for which an outline is being generated.
If the current section has no heading, create an implied heading and let that be the heading for the current section. Skip to the next step in the overall set of steps. (The walk is over.)
Recall that h1 has the highest rank, and h6 has
the lowest rank.
body element of
a {{Document}} is the outline of the entire document.
When creating an interactive table of contents, entries should jump the user to the relevant
sectioning content element, if the section was created for a real element in the
original document, or to the relevant heading content element, if the section in
the tree was generated for a heading in the above process.
Selecting the first section of the document therefore always takes the user to the top
of the document, regardless of where the first heading in the body is to be
found.
Hello world.
function (root, enter, exit) {
var node = root;
start: while (node) {
enter(node);
if (node.firstChild) {
node = node.firstChild;
continue start;
}
while (node) {
exit(node);
if (node == root) {
node = null;
} else if (node.nextSibling) {
node = node.nextSibling;
continue start;
} else {
node = node.parentNode;
}
}
}
}
| Element | Purpose |
|---|---|
| Example | |
| <{body}> | |
|
Hard Trance is My Life. |
|
| <{article}> | |
Masif tee
My fave Masif tee so far! Masif's birthday
Happy 2nd birthday Masif Saturdays!!! |
|
| <{section}> | |
BiographyThe facts1500+ shows, 14+ countries 2010/2011 figures per year100+ shows, 8+ countries |
|
| <{nav}> | |
|
|
|
| <{aside}> | |
MusicAs any burner can tell you, the event has a lot of trance. This year we played a kind of trance that originated in Belgium, Germany, and the Netherlands in the mid 90s. |
|
<{h1}>–h6 |
A section heading |
The Guide To Music On The PlayaThe Main StageIf you want to play on a stage, you should bring one. Amplified MusicAmplifiers up to 300W or 90dB are welcome. |
|
| <{header}> | |
Hard Trance is My LifeBy DJ Steve Hill and Technikal The album with the amusing punctuation has red artwork. |
|
| <{footer}> | |
Hard Trance is My LifeThe album with the amusing punctuation has red artwork. |