A <{p}> element's end tag may be omitted if the <{p}> element is
immediately followed by an <{address}>, <{article}>, <{aside}>, <{blockquote}>, <{details}>,
<{div}>, <{dl}>, <{fieldset}>, <{figcaption}>, <{figure}>, <{footer}>, <{form}>, <{h1}>,
<{h2}>, <{h3}>, <{h4}>, <{h5}>, <{h6}>, <{header}>, <{hr}>, <{main}>, <{nav}>,
<{ol}>, <{p}>, <{pre}>, <{section}>, <{table}>, or <{ul}>, element, or if
there is no more content in the parent element and the parent element is an
HTML element that is not an <{a}>, <{audio}>, <{del}>, <{ins}>, <{map}>, <{noscript}>,
or <{video}> element.
The <{p}> element represents a block of content, a paragraphas defined in this specification.
The <{p}> element should not be used when a more specific element, such as a list, is more appropriate.
Some block elements cannot be children of <{p}> elements.
When the parser finds them, it automatically closes the <{p}> element - effectively inserting a
</p> tag.
These elements are: heading content, most sectioning roots and sectioning content,
<{form}>, <{fieldset}>, <{table}>, <{ol}>, <{ul}>, and <{legend}>.
Paragraphs are usually represented visually as blocks of text, separated from adjacent blocks by blank lines.
However a style sheet or user agent may present paragraph breaks in a different manner, for instance using inline pilcrows (¶).
The following examples are conforming HTML fragments:
The little kitten gently seated itself on a piece of carpet. Later in his life, this would be referred to as the time the cat sat on the mat.
There was once an example from Femley,
Whose markup was of dubious quality.
The validator complained,
So the author was pained,
To move the error from the markup to the rhyming.
;
The following example is technically conforming HTML:
Last modified: 2001-04-23
Author: fred@example.com
However, it would be better marked-up as:
Author: fred@example.com
Or:
Among others, list elements (e.g. <{li}>, <{ol}>, and <{ul}>) cannot be children of <{p}> elements.
So to mark up a sentence that contains a list, like the following:
For instance, this fantastic sentence has bullets relating to
* wizards,
* faster-than-light travel, and
* telepathy,
and is further discussed below.
it is important to remember that a paragraph in HTML does not have the semantic meaning of "a single idea"
that is a usual part of how English grammar describes "paragraphs". Instead it is merely a default type of block-level structure for content.
In the example above, there are five block-level structures: one before the list, one for each bullet, and one after the list.
The markup for the above example could therefore be:
For instance, this fantastic sentence has bullets relating to
wizards,
faster-than-light travel, and
telepathy,
and is further discussed below.
Authors wishing to conveniently style such "logical" paragraphs consisting of multiple
"structural" paragraphs can use the <{div}> element instead of, or as well as the <{p}> element.
Thus for instance the above example could become the following:
For instance, this fantastic sentence has bullets relating to
wizards,
faster-than-light travel, and
telepathy,
and is further discussed below.
or
For instance, this fantastic sentence has bullets relating to
wizards,
faster-than-light travel, and
telepathy,
and is further discussed below.
These examples still have five structural blocks, but now the author can style just the
div instead of having to consider each part of the example separately.
The <{address}> element represents contact information for a person, people or
organization. It should include physical and/or digital location/contact information, and a
means of identifying a person(s) or organization the information pertains to.
Address, telephone and fax numbers for an organization:
UNIVERSITY INTERSCHOLASTIC LEAGUE
1701 Manor Road, Austin, TX 78722
Tel: (512) 471-5883 | Fax: (512) 471-5908
The address part of a form output:
...
...
Name: Hament Dhanji
House number: 123
Street: Example Road
...
Location of a cat:
Lola the cat is at
Latitude: 51.47852
Longitude: -0.1449519
The meaning and usage contexts of the address element is broad. If developers wish
to provide more granular and specific semantics for the address element, it is
suggested to use of any of the various semantic web metadata schemas.
For example, the postal address of a local business
annotated using RDFa:
<div vocab="http://schema.org/" typeof="LocalBusiness">
<h1><span property="name">Beachwear & Giftware</span></h1>
<p property="description">
A superb collection of fine gifts and clothing to accent your stay in Mexico Beach.
</p>
<address property="address" typeof="PostalAddress">
<span property="streetAddress">123 Example Street</span>
<span property="addressLocality">Mexico Beach</span>,
<span property="addressRegion">FL</span>
</address>
Phone: <span property="telephone">(212) 664-7665</span>
</div>
The <{hr}> element represents a paragraph-level thematic break, such as a
scene change in a story, or a transition to another topic within a section of a reference book.
The following fictional extract from a project manual shows two sections that use the
<{hr}> element to separate topics within the section.
Communication
There are various methods of communication. This section covers a few of the important ones used by the project.
Communication stones seem to come in pairs and have mysterious properties:
They can transfer thoughts in two directions once activated if used alone.
If used with another device, they can transfer one's consciousness to another body.
If both stones are used with another device, the consciousnesses switch bodies.
Radios use the electromagnetic spectrum in the meter range and longer.
Signal flares use the electromagnetic spectrum in the nanometer range.
Food
All food at the project is rationed:
Potatoes
Two per day
Soup
One bowl per day
Cooking is done by the chefs on a set rotation.
There is no need for an <{hr}> element between the sections themselves, since the
<{section}> elements and the h1 elements imply thematic changes themselves.
The following extract from Pride and Prejedice by Jane Austen shows a paragraph
that precedes a scene change and the paragraph that follows it. The scene change, represented
in the printed book by a gap containing a solitary centered star between the second
and third paragraphs, is here represented using the <{hr}> element.
Elizabeth told her the motives of her secrecy. She had been unwilling to mention Bingley; and the unsettled state of her own feelings had made her equally avoid the name of his friend. But now she would no longer conceal from her his share in Lydia’s marriage. All was acknowledged, and half the night spent in conversation.
“Good gracious!” cried Mrs. Bennet, as she stood at a window the next morning, “if that disagreeable Mr. Darcy is not coming here again with our dear Bingley! What can he mean by being so tiresome as to be always coming here? I had no notion but he would go a-shooting, or something or other, and not disturb us with his company. What shall we do with him? Lizzy, you must walk out with him again, that he may not be in Bingley’s way.”
The <{hr}> element does not affect the document's outline.
The <{pre}> element represents a block of preformatted text, in which structure is
represented by typographic conventions rather than by elements.
In the HTML syntax, a leading newline character immediately following the
<{pre}> element start tag is stripped.
Some examples of cases where the <{pre}> element could be used:
* Including an e-mail, with paragraphs indicated by blank lines, lists indicated by lines prefixed
with a bullet, and so on.
* Including fragments of computer code, with structure indicated according to the conventions of
that language.
* Displaying ASCII art.
Authors are encouraged to consider how preformatted text will be experienced when the
formatting is lost, as will be the case for users of speech synthesizers, braille displays,
and the like. For cases like ASCII art, it is likely that an alternative presentation, such
as a textual description, would be more universally accessible to the readers of the document.
To represent a block of computer code, the <{pre}> element can be used with a <{code}> element;
to represent a block of computer output the <{pre}> element can be used with a <{samp}> element.
Similarly, the <{kbd}> element can be used within a <{pre}> element to indicate text that the
user is to enter.
In the following snippet, a sample of computer code is presented.
This is the Panel constructor:
function Panel(element, canClose, closeHandler) {
this.element = element;
this.canClose = canClose;
this.closeHandler = function () { if (closeHandler) closeHandler() };
}
In the following snippet, samp and <{kbd}> elements are mixed in the
contents of a <{pre}> element to show a session of Zork I.
You are in an open field west of a big white house with a boarded
front door.
There is a small mailbox here.
>open mailboxOpening the mailbox reveals:
A leaflet.
>
The following shows a contemporary poem that uses the <{pre}> element to preserve its
unusual formatting, which forms an intrinsic part of the poem itself.
maxling
it is with a heart
heavy
that i admit loss of a feline
so loved
a friend lost to the
unknown
(night)
~cdr 11dec07
The HTMLQuoteElement interface is also used by the <{q}> element.
The <{blockquote}> element represents content that is quoted from another source,
optionally with a citation which must be within a footer or cite
element, and optionally with in-line changes such as annotations and abbreviations.
Content inside a blockquote other than citations and in-line changes must be quoted
from another source, whose address, if it has one, may be cited in the
cite attribute.
In cases where a page contains contributions from multiple people, such as comments on a blog
post, 'another source' can include text from the same page, written by another person.
If the <{blockquote/cite}> attribute is present, it must be a
valid URL potentially surrounded by spaces. To obtain the corresponding citation link, the
value of the attribute must be parsed relative to the element's node document.
User agents may allow users to follow such citation links, but they are primarily intended for
private use (e.g., by server-side scripts collecting statistics about a site's use of
quotations), not for readers.
The cite IDL attribute must
reflect the element's <{blockquote/cite}> content attribute.
The content of a <{blockquote}> may be abbreviated, may have context added or may have
annotations. Any such additions or changes to quoted text must be indicated in the text (at the
text level). This may mean the use of notational conventions or explicit remarks, such as
"emphasis mine".
For example, in English, abbreviations are traditionally identified using square brackets.
Consider a page with the sentence "Fred ate the cracker. He then said he liked apples and
fish."; it could be quoted as follows:
[Fred] then said he liked [...] fish.
Quotation marks may be used to delineate between quoted text and annotations within a
<{blockquote}>.
For example, an in-line note provided by the author:
"That monster custom, who all sense doth eat Of habit's devil," &c. not in Folio
"What a falling off was there! From me, whose love was of that dignity That it went hand in hand even with the vow I made to her in marriage, and to decline Upon a wretch."
In the example above, the citation is contained within the <{footer}> of a
<{figure}> element, this groups and associates the information, about the quote, with
the quote. The <{figcaption}> element was not used, in this case, as a container for
the citation as it is not a caption.
Attribution for the quotation, may be placed inside the <{blockquote}> element, but
must be within a <{cite}> element for in-text attributions or within a <{footer}> element.
For example, here the attribution is given in a footer after the quoted text, to
clearly relate the quote to its attribution:
I contend that we are both atheists. I just believe in one fewer god than you do. When you understand why you dismiss all the other possible gods, you will understand why I dismiss yours.
Here the attribution is given in a <{cite}> element on the last line of the quoted
text. Note that a link to the author is also included.
The people recognize themselves in their commodities; they find their soul in their automobile, hi-fi set, split-level home, kitchen equipment. — Herbert Marcuse
Here the attribution is given in a footer after the quoted text, and metadata
about the reference has been added using the RDFA Lite syntax. [[rdfa-lite]]
... she said she would not sign any deposition containing the word "amorous" instead of "advances". For her the difference was of crucial significance, and one of the reasons she had separated from her husband was that he had never been amorous but had consistently made advances.
There is no formal method for indicating the markup in a blockquote is from a
quoted source. It is suggested that if the footer or <{cite}> elements are
included and these elements are also being used within a blockquote to identify
citations, the elements from the quoted source could be annotated with metadata to identify
their origin, for example by using the <{global/class}> attribute (a defined
extensibility mechanism).
In this example the source of a quote includes a <{cite}> element, which is annotated
using the <{global/class}> attribute:
My favorite book is At Swim-Two-Birds
The other examples below show other ways of showing attribution.
Here a <{blockquote}> element is used in conjunction with a <{figure}> element
and its figcaption:
The truth may be puzzling. It may take some work to grapple with. It may be counterintuitive. It may contradict deeply held prejudices. It may not be consonant with what we desperately want to be true. But our preferences do not determine what's true.
We have a method, and that method helps us to reach not absolute truth, only asymptotic approaches to the truth — never there, just closer and closer, always finding vast new oceans of undiscovered possibilities. Cleverly designed experiments are the key.
Carl Sagan, in "Wonder and Skepticism", from the Skeptical Inquirer Volume 19, Issue 1 (January-February 1995)
This next example shows the use of cite alongside blockquote:
His next piece was the aptly named Sonnet 130:
My mistress' eyes are nothing like the sun,
Coral is far more red, than her lips red,
...
This example shows how a forum post could use blockquote to show what post a user
is replying to. The <{article}> element is used for each post, to mark up the threading.
Next thing you'll be saying they don't get capes and wizard hats either!
boing -5 points 1 hour ago
narwhals are worse than ceiling cat
fred 1 points 23 minutes ago
I bet a narwhal would love that.
I bet they'd love to peel a banana too.
This example shows the use of a blockquote for short snippets, demonstrating that
one does not have to use <{p}> elements inside <{blockquote}> elements:
She began a list of quotations with the following:
It is a truth universally acknowledged, that a single man in possession of a good fortune, must be in want of a wife.
She continued with a number of similar quotes, ending with:
The person, be it gentleman or lady, who has not pleasure in a good novel, must be intolerably stupid.
The <{ol}> element represents a list of items, where the items have been
intentionally ordered, such that changing the order would change the meaning of the document.
The items of the list are the <{li}> element child nodes of the <{ol}> element,
in tree order.
The reversed attribute is a
boolean attribute. If present, it indicates that the list is a descending list
(..., 3, 2, 1). If the attribute is omitted, the list is an ascending list (1, 2, 3, ...).
The start attribute, if present, must be a
valid integer giving the ordinal value of the first list item.
If the start attribute is present, user agents must parse it as an integer,
in order to determine the attribute's value. The default value, used if the attribute is
missing or if the value cannot be converted to a number according to the referenced algorithm,
is 1 if the element has no reversed attribute, and is the number of child
li elements otherwise.
The first item in the list has the ordinal value given by the <{ol}> element's
start attribute, unless that <{li}> element has a value
attribute with a value that can be successfully parsed, in which case it has the
ordinal value given by that value attribute.
Each subsequent item in the list has the ordinal value given by its value
attribute, if it has one, or, if it doesn't, the ordinal value of the previous item, plus
one if the reversed is absent, or minus one if it is present.
The type attribute can be used to specify the
kind of marker to use in the list, in the cases where that matters (e.g., because items are to
be referenced by their number/letter). The attribute, if specified, must have a value that is a
case-sensitive match for one of the characters given in the first cell of one of the rows
of the following table.
The type attribute represents the state given in the cell in the second column of
the row whose first cell matches the attribute's value; if none of the cells match, or if the
attribute is omitted, then the attribute represents the decimal state.
Keyword
State
Description
Examples for values 1-3 and 3999-4001
1 (U+0031)
decimal
Decimal numbers
1.
2.
3.
...
3999.
4000.
4001.
...
a (U+0061)
lower-alpha
Lowercase latin alphabet
a.
b.
c.
...
ewu.
ewv.
eww.
...
A (U+0041)
upper-alpha
Uppercase latin alphabet
A.
B.
C.
...
EWU.
EWV.
EWW.
...
i (U+0069)
lower-roman
Lowercase roman numerals
i.
ii.
iii.
...
mmmcmxcix.
i̅v̅.
i̅v̅i.
...
I (U+0049)
upper-roman
Uppercase roman numerals
I.
II.
III.
...
MMMCMXCIX.
I̅V̅.
I̅V̅I.
...
User agents should render the items of the list in a manner consistent with the state of the
type attribute of the <{ol}> element. Numbers less than or equal to zero
should always use the decimal system regardless of the type attribute.
For CSS user agents, a mapping for this attribute to the 'list-style-type' CSS property is
given in the [[#rendering]] section (the mapping is straightforward: the states above have
the same names as their corresponding CSS values).
It is possible to redefine the default CSS list styles used to implement this attribute in CSS
user agents; doing so will affect how list items are rendered.
The reversed, start, and
type IDL attributes must reflect
the respective content attributes of the same name. The start IDL attribute has the
same default as its content attribute.
The following markup shows a list where the order matters, and where the ol
element is therefore appropriate. Compare this list to the equivalent list in the
ul section to see an example of the same items using the <{ul}> element.
I have lived in the following countries (given in the order of when I first lived there):
Switzerland
United Kingdom
United States
Norway
Note how changing the order of the list changes the meaning of the document. In the following
example, changing the relative order of the first two items has changed the birthplace of the
author:
I have lived in the following countries (given in the order of when I first lived there):
The <{ul}> element represents a list of items, where the order of the items is not
important — that is, where changing the order would not materially change the meaning of the
document.
The items of the list are the <{li}> element child nodes of the <{ul}> element.
The following markup shows a list where the order does not matter, and where the
ul element is therefore appropriate. Compare this list to the equivalent list
in the ol section to see an example of the same items using the <{ol}> element.
I have lived in the following countries:
Norway
Switzerland
United Kingdom
United States
Note that changing the order of the list does not change the meaning of the document. The
items in the snippet above are given in alphabetical order, but in the snippet below they
are given in order of the size of their current account balance in 2007, without changing
the meaning of the document whatsoever:
An <{li}> element's end tag may be omitted if the <{li}> element is immediately
followed by another <{li}> element or if there is no more content in the parent element.
The <{li}> element represents a list item. If its parent element is an <{ol}>, or <{ul}>,
then the element is an item of the parent element's list, as defined for those elements.
Otherwise, the list item has no defined list-related relationship to any other <{li}> element.
If the parent element is an <{ol}> element, then the <{li}> element has an
ordinal value.
The value attribute, if present, must be a
valid integer giving the ordinal value of the list item.
If the value attribute is present, user agents must parse it as an integer,
in order to determine the attribute's value. If the attribute's value cannot be converted to a
number, the attribute must be treated as if it was absent. The attribute has no default value.
The value attribute is processed relative to the element's parent ol
element (q.v.), if there is one. If there is not, the attribute has no effect.
The value IDL attribute must
reflect the value of the value content attribute.
The following example, the top ten movies are listed (in reverse order). Note the way the list
is given a title by using a <{figure}> element and its <{figcaption}> element.
The top 10 movies of all time
Josie and the Pussycats, 2001
Црна мачка, бели мачор, 1998
A Bug's Life, 1998
Toy Story, 1995
Monsters, Inc, 2001
Cars, 2006
Toy Story 2, 1999
Finding Nemo, 2003
The Incredibles, 2004
Ratatouille, 2007
The markup could also be written as follows, using the reversed attribute on the
<{ol}> element:
The top 10 movies of all time
Josie and the Pussycats, 2001
Црна мачка, бели мачор, 1998
A Bug's Life, 1998
Toy Story, 1995
Monsters, Inc, 2001
Cars, 2006
Toy Story 2, 1999
Finding Nemo, 2003
The Incredibles, 2004
Ratatouille, 2007
While it is conforming to include heading elements (e.g., h2) and
Sectioning content inside li elements, it likely does not convey the
semantics that the author intended. A heading starts a new section, so a heading in a list
implicitly splits the list into spanning multiple sections. Sectioning content
explicitly creates a new section and so splits the list into spanning multiple sections.
Either:Zero or more groups each consisting of one or more <{dt}> elements followed by one or
more <{dd}> elements, optionally intermixed with script-supporting elements.
Or: One or more <{div}> elements, optionally intermixed with script-supporting elements.
The <{dl}> element represents a description list of zero or more
term-description groups.
Each term-description group consists of one or more terms (represented by <{dt}> elements)
and one or more descriptions (represented by <{dd}> elements.
The div element may be used as a child of the <{dl}> element (as a way to organize
term-description groups consisting of one or more <{dt}> elements, and one or more
<{dd}> elements).
Term-description groups may be names and definitions, questions and answers, categories
and topics, or any other groups of term-description pairs.
In this example a <{dl}> is used to represent a simple list of names and descriptions:
Blanco tequila
The purest form of the blue agave spirit...
Reposado tequila
Typically aged in wooden barrels for between two and eleven months...
Each term within a term-description group must be represented by a single <{dt}> element.
The descriptions within a term-description group are alternatives. Each description must
be represented by a single <{dd}> element.
In this example a <{dl}> element represents a set of terms, each of which has multiple
descriptions:
Information about the rock band Queen:
Members
Brian May
Freddie Mercury
John Deacon
Roger Taylor
Record labels
EMI
Parlophone
Capitol
Hollywood
Island
The <{div}> element may be used to contain a term-description group, consisting of at
least one <{dt}> and at least one <{dd}> element.
In this example the <{div}> element is used as a styling container for a
term-description group:
Black teas
Assam
Darjeeling
Green teas
Gunpowder
A <{div}> element that is a child of a <{dl}> element, must contain at least one
term-description group consisting of at least one <{dt}> element and at least one <{dd}>
element.
In this example the <{div}> element is ignored because it does not contain a
term-description group:
Important questions:
What is the answer to life, the universe, and everything?
42
The order of term-description groups within a <{dl}> element, and the order of terms and
descriptions within each group, may be significant.
In this example a <{dl}> is used to show a set of instructions, where the order of the
instructions is important:
Determine the victory points as follows (use the first matching case):
If you have exactly five gold coins
You get five victory points
If you have one or more gold coins, and you have one or more silver coins
You get two victory points
If you have one or more silver coins
You get one victory point
Otherwise
You get no victory points
If a <{dl}> element contains no <{dt}> or <{dd}> child elements, it contains no
term-description groups.
When a <{dl}> element does not match its content model, it is often because a <{dd}> element
has been used instead of a <{dt}> element, or vice versa.
In this example the <{dt}> elements represent questions and the <{dd}> elements the answers:
What is my favorite drink?
Tea
What is my favorite food?
Sushi
What is my favourite film?
What a Wonderful Life
When used within a <{dl}> element, the <{dt}> element does not necessarily represent a term being defined. The <{dfn}> element should be used to represent a term being defined.
In this example the <{dfn}> element indicates that the <{dt}> element contains a defined term, the definition for which is represented by the <{dd}> element:
Color
Colour
A sensation which (in humans) derives from the ability of the fine structure of the eye to distinguish three differently filtered analyses of a view.
A <{dd}> element's end tag may be omitted if the <{dd}> element is
immediately followed by another <{dd}> element or a <{dt}> element, or if
there is no more content in the parent element.
The <{figure}> element represents some flow content, optionally with a caption,
that is self-contained (like a complete sentence) and is typically referenced as a single
unit from the main flow of the document.
"Self-contained" in this context does not necessarily mean independent. For example, each
sentence in a paragraph is self-contained; an image that is part of a sentence would be
inappropriate for <{figure}>, but an entire sentence made of images would be fitting.
The element can thus be used to annotate illustrations, diagrams, photos, code snippets, etc.
When a <{figure}> is referred to from the main content of the document by identifying
it by its caption (e.g., by figure number), it enables such content to be easily moved away
from that primary content, e.g., to the side of the page, to dedicated pages, or to an
appendix, without affecting the flow of the document.
If a figure element is referenced by its relative position,
e.g., "in the photograph above" or "as the next figure shows", then moving the figure would
disrupt the page's meaning. Authors are encouraged to consider using labels to refer to
figures, rather than using such relative references, so that the page can easily be restyled
without affecting the page's meaning.
If a <{figure}> element has a child <{figcaption}> element, that element represents the caption
of the <{figure}> element's contents. If there is no child figcaption element, then
the <{figure}> has no caption.
A <{figure}> element's contents are part of the surrounding flow. If the purpose of the
page is to display the figure, for example a photograph on an image sharing site, the
figure and <{figcaption}> elements can be used to explicitly provide a
caption for that figure. For content that is only tangentially related, or that serves a separate
purpose than the surrounding flow, the <{aside}> element should be used (and can itself
wrap a <{figure}>). For example, a pull quote that repeats content from an <{article}> would be
more appropriate in an <{aside}> than in a <{figure}>, because it isn't part of the content,
it's a repetition of the content for the purposes of enticing readers or highlighting key topics.
This example shows the <{figure}> element to mark up a code listing.
In listing 4 we see the primary core interface API declaration.
Listing 4. The primary core interface API declaration.
Here we see a <{figure}> element to mark up a photo that is the main content of the
page (as in a gallery).
Bubbles at work — My Gallery™Bubbles at work
In this example, we see an image that is not a figure, as well as an image and a video
that are. The first image is literally part of the example's second sentence, so it's not a
self-contained unit, and thus figure would be inappropriate.
Malinko's comics
This case centered on some sort of "intellectual property" infringement related to a comic (see Exhibit A). The suit started after a trailer ending with these words:
...was aired. A lawyer, armed with a Bigger Notebook, launched a preemptive strike using snowballs. A complete copy of the trailer is included with Exhibit B.
Exhibit A. The alleged rough copy comic.Exhibit B. The Rough Copy trailer.
The case was resolved out of court.
Here, a part of a poem is marked up using <{figure}>.
'Twas brillig, and the slithy toves
Did gyre and gimble in the wabe;
All mimsy were the borogoves,
And the mome raths outgrabe.
Jabberwocky (first verse). Lewis Carroll, 1832-98
In this example, which could be part of a much larger work discussing a castle, nested
<{figure}> elements are used to provide both a group caption and individual captions for
each figure in the group.
The castle through the ages: 1423, 1858, and 1999 respectively.Etching. Anonymous, ca. 1423.Oil-based paint on canvas. Maria Towle, 1858.Film photograph. Peter Jankle, 1999.
The figure is sometimes referenced only implicitly from the content:
Fiscal negotiations stumble in Congress as deadline nears
Barack Obama and Harry Reid. White House press photograph.
Negotiations in Congress to end the fiscal impasse sputtered on Tuesday, leaving both chambers grasping for a way to reopen the government and raise the country's borrowing authority with a Thursday deadline drawing near.
The <{figcaption}> element represents a caption or legend for the rest of the
contents of the <{figcaption}> element's parent <{figure}> element, if any.
There should be no more than one child <{figcaption}> element to a single
parent <{figure}> element.
If a <{table}> element is the only content of a <{figure}> element, other than the
<{figcaption}>, the <{caption}> element should be omitted in favor of the
figcaption.
The following example shows an erroneous <{figure}> with two <{figcaption}> elements.
Using appropriate markup will lead to less confusion and more accessible code.
What am I?
Instead the author should have used a button element to ensure proper semantics and keyboard functionality were preserved.
Instead of providing two captions to the <{figure}>, the markup should have been
written as follows:
What am I?
Using appropriate markup will lead to less confusion and more accessible code.
Instead the author should have used a button element to ensure proper semantics and keyboard functionality were preserved.
The <{main}> element is not suitable for identifying the main content areas of sub-sections of a document. The simplest solution is not to mark up the main content of a sub-section at all (leaving it as implicit), but an author could use [[#grouping-content]] or a sectioning content element as appropriate.
..................
In the following example, we see 2 articles about skateboards (the main topic of a Web page) the
main topic content is identified by the use of the <{main}> element.
Skateboards
The skateboard is the way cool kids get around
Longboards
Longboards are a type of skateboard with a longer wheelbase and larger, softer wheels.
...
...
Electric Skateboards
These no longer require the propelling of the skateboard by means of the feet; rather an electric motor propels the board, fed by an electric battery.
...
...
Here is a graduation programme, in which the main content section is defined by the use of the
<{main}> element. Note in this example the <{main}> element contains a
<{nav}> element consisting of links to sub sections of the main content.
In the next example, both the <{header}> and the <{footer}> are outside the <{main}> element
because they are generic to the website and not specific to <{main}>'s content.
Great Dogs for Families
The Border Terrier
Welcome!
This site is all about the Border Terrier, the best breed of dog that there is!
Here, the same generic <{header}> and <{footer}> elements remain outside <{main}>, but there
is an additional <{header}> element within the <{main}> element as its content is relevant to
the content within <{main}> because it contains a relevant heading and in-page navigation.
The in-page navigation is repeated within a <{footer}> which is again within the <{main}> element.
Great Dogs for Families
The Border Terrier
About
Basic Information
The Border Terrier is a small, rough-coated breed of dog of the terrier group, originally bred as fox and vermin hunters. [...]
Appearance
Identifiable by their otter-shaped heads, Border Terriers have a broad skull and short (although many be fairly long), strong muzzle with a scissors bite. [...]
Temperament
Though sometimes stubborn and strong willed, border terriers are, on the whole very even tempered, and are friendly and rarely aggressive. [...]
This example is largely the same as the previous one except that it includes an <{aside}>.
The content of the <{aside}> is considered to be relevant to the content within the <{main}>
element, which is all about the Border Terrier, so the <{aside}> is placed within the
<{main}> element.
Great Dogs for Families
The Border Terrier
About
Basic Information
The Border Terrier is a small, rough-coated breed of dog of the terrier group, originally bred as fox and vermin hunters. [...]
Appearance
Identifiable by their otter-shaped heads, Border Terriers have a broad skull and short (although many be fairly long), strong muzzle with a scissors bite. [...]
Temperament
Though sometimes stubborn and strong willed, border terriers are, on the whole very even tempered, and are friendly and rarely aggressive. [...]
In the following example, two <{aside}> elements containg adverts have been placed outside
the <{main}> element as their content is not specific to the content within <{main}>. These
<{aside}>s could be on any page, as they are as generic as the <{header}> and <{footer}>
shown.
Great Dogs for Families
The Border Terrier
Welcome!
This site is all about the Border Terrier, the best breed of dog
that there is!
If the element is a child of a dl element: one or more <{dt}> elements
followed by one or more <{dd}> elements, optionally intermixed with script-supporting elements.
If the element is not a child of a dl element: Flow content.
The <{div}> element has no special meaning at all. It represents its children. It
can be used with the <{global/class}>, <{global/lang}>, and <{global/title}> attributes to
mark up semantics common to a group of consecutive elements.
Authors are strongly encouraged to view the <{div}> element as an element of last
resort, for when no other element is suitable. Use of more appropriate elements instead of the
<{div}> element leads to better accessibility for readers and easier maintainability
for authors.
For example, a blog post would be marked up using <{article}>, a chapter using
<{section}>, a page's navigation aids using <{nav}>, and a group of form
controls using <{fieldset}>.
On the other hand, <{div}> elements can be useful for stylistic purposes or to wrap
multiple paragraphs within a section that are all to be annotated in a similar way. In the
following example, we see <{div}> elements used as a way to set the language of two
paragraphs at once, instead of setting the language on the two paragraph elements separately:
My use of language and my cats
My cat's behavior hasn't changed much since her absence, except that she plays her new physique to the neighbors regularly, in an attempt to get pets.
My other cat, colored black and white, is a sweetie. He followed us to the pool today, walking down the pavement with us. Yesterday he apparently visited our neighbours. I wonder if he recognizes that their flat is a mirror image of ours.
Hm, I just noticed that in the last paragraph I used British English. But I'm supposed to write in American English. So I shouldn't say "pavement" or "flat" or "color"...
I should say "sidewalk" and "apartment" and "color"!