Examples of Inline Semantic Elements, Non-Semantic Elements, and Special Characters
This page is for testing screen reader and accessibility API support for semantics and/or style reporting on inline HTML elements and certain character entities. MDN maintains a complete listing of inline text semantics, including tags for demarcating edits. This page contains a large portion of those tags. We apply a light gray background to all tagged text, though not to the blockquote element, which should be visually set off in browsers because they tend to indent blockquote by default. Any other styling, except the font face, is supplied by the browser.
If you are going to use a screen reader for testing how the tags and characters on this page are spoken, you might test both with the screen reader's default verbosity and with verbosity set to its highest level. And for the fullest picture, navigate both at the sentence or word level and character-by-character.
B, Strong, I, Em
Elements that are marked bold or wrapped with an italics tag should have style but not convey semantics. On the other hand, elements marked with the strong tag should convey strong importance or urgency and elements wrapped with an em tag should convey stressed emphasis.
Blockquote, Cite, Q, S, U, Mark, Del, Ins, and ARIA 1.3 Annotations
A blockquote is supposed to contain an extended quotation, like this q element that is followed by a cite element, all within a blockquote:
The aim of science is to seek the simplest explanations of complex facts. We are apt to fall into the error of thinking that the facts are simple because simplicity is the goal of our quest. The guiding motto in the life of every natural philosopher should be, Seek simplicity and distrust it.
The Concept of Nature – Alfred North Whitehead (1919)
You might also see the s tag, which may render with a line through it, possibly to indicate that the text
is no longer relevent but
which does not indicate the same thing that the del element does — that text has been removed in
an edit. The counterpart
of del is the ins element, which indicates insertion of new text content. Other forms of text
annotation are
the mark element, which indicates text highlighted for notation or reference because the text has
some importance. And
the u element, which indicates a non-textual annotation, such as a spelling error.
In ARIA 1.3, the mark
, del
, and ins
tags will be getting
annotation roles that
should be surfaced in
assistive technologies. Here are these tags, with their role attributes, and a couple span
tags for
roles that don't have an
HTML tag analog.The ins tag represents inserted content, the
del tag represents a deletion. If
some content is to be deleted and then
replaced by inserted content, it can
all be wrapped within a tag
with a role of suggestion. The
mark tag denotes elements containing text that is marked/highlighted for reference
purposes. And you can mark up a
reaction to some content on the page via role of comment.
The ARIA 1.3 annotation roles also include mechanisms for referencing annotated content using
aria-details=[ids of annotated elements]
so that, for example, a comment could reference a
deletion/insertion suggested edit.
The MDN page linked above has many examples. But as of July 2022 there is little support for the semantics being
exposed in browsers
(Firefox by default and Chrome behind a flag) and no screen readers are supporting speech with this markup.
Sub, Sup, Var, Code, Kbd, Samp, and various Trademark-related symbols
- Superscript of a trademark symbol: Keds™ shoes
- Superscript of a registration symbol: Keds® shoes
- Superscript of a copyright symbol: Keds© shoes
- Superscript of a service mark symbol: Keds℠ shoes
- Subscript in a chemical formula: Water is H2O
- Var indicates the name of a variable in math or programming: d is a variable representing diameter
- Code is text styled to represent code from a programming language:
goto()
is code for an obsolete function - Kbd is text representing keyboard input from the user. The keyboard shortcut for copy is Ctrl + c
- Samp or sample is inline text representing computer output. Grep without any argumnents returns Try 'grep --help' for more information.
Time, Abbr, Span
- Use the time tag to make times in HTML machine readable. For example, represents 2 September 1919
- Use the abbr tag for abbreviations, such as CSS
- If you need a non-semantic run of inline text, use the span tag
span
of course can be used to create bolded text using just CSS- and italicized text using just CSS, too
Commonly Used Special Characters
- A hyphen by itself, ‐ and in a hyphenated word, dog‐fearing
- The underscore character by itself, _ and in a file name, by_request_only.jpg
- An en dash – and an em dash — character
- An ellipsis by itself, … and used in single and double-quoted sentences: “The map to the treasure said go to the top of … (omitted out of concern for historical preservation).” and ‘The storm clouds foretold a rough voyage, or… could it be, well, just some rain?’
- Paragraph and section symbols: ¶ and §
- A minus symbol by itself, − and preceding a number, −100 and preceding a dollar amount, −$100
- Plus and plus or minus: + and, for increasing amounts, +100 and for plus or minus an amount, ±30
-
For inline equations and equalities:
- 30 ÷ 2 × 3 = 45 but
- 30 ÷ (2 × 3) ≠ 45
- 12 > 11
- 11 < 12
- ¾ > ½ > ¼
- Cats ⋜ 2 years old are welcome!
- Dogs ⋝ 10 years old are precious
- π ≈ 3.1415
- It is nearly 90° outside!
- The percent sign alone, % and as a percentage number, 18%
-
Currency symbols, alone and with numbers:
- $
- $100
- ¢
- .10¢
- €
- €20
- £
- £35
- ¥
- ¥10,000
- The at symbol alone: @ Preceding a name: @joe And within an email: joe@joebob.com
- The star or asterisk symbol ( * ) with the number or hash symbol ( # ): See *Note #42
- Pipe, back and forward slashes (solidus), brackets, and braces: http://microsoft.com contains a / character, while C:\Users\joe\test.txt contains a \ character. The command ls | more contains the | character. The [ and ] characters are used frequently in markdown such as this, ![Tux, the Linux penguin](/assets/image/tux.png) And in markdown you would use a \ to escape curly braces, such as { and } if you wanted to write the range {0-9}