HTML elements used to contain text.
Contents
Blockquote
Used to denote quoted content.
Demo:
blockquoteblockquote
Code
Used to denote code. On Wacky, the style of
<code>
changes when directly placed inside a<p>
,<li>
or<pre>
.The background of the demo box has been darkened to improve contrast.
Demo:
code
<code>code</code>
code
<p> <code>code</code> </p>
code
<li> <code>code</code> </li>
code
<pre> <code>code</code> </pre>
Paragraph
Separates long passages of text into paragraphs.
Demo:
paragraph 1
paragraph 2
<p>paragraph 1</p> <p>paragraph 2</p>
lang=""
Used to specify the language of the text. This attribute only accepts ISO 639-1 language codes as values, see here for a full list.
Aside from semantics, specifying the language will ensure that browsers render non-english characters correctly (issue described here).
Demo:
This text is in English
<p lang="en">This text is in English</p>
Preformatted Text
Used to denote that the text has been preformatted. This is useful as it prevents line wrapping and preserves whitespaces and line breaks therefore retaining text structure.
Demo:
Consecutive whitespace characters are retained
<pre>Consecutive whitespace characters are retained</pre>