Text-formatting Elements
Purpose
Element
Description
Self-Closing
Headings
h1, h2, h3, h4, h5, h6
Six levels of section headings
False
Paragraphs
p
Section of text, like in print
False
Line Break
br
Separates content with a carriage-return
True
Horizontal Rule
hr
A line to separate content
True
Lists
ul, ol, li
Ordered and unordered lists
False
Text emphasis
em
Emphasizes text
False
Text importance
strong
Singles out important text
False
Bold
b
Changes text to bold
False
Italic
i
Changes text to italic
False
Blockquote
blockquote
A quote, with optional citation
False
Headings - <h1>, <h2>, <h3>, <h4>, <h5>, <h6>
The use of headings and sub-headings to organize the content of the document is likely familiar to you from their use in Word and Google documents. These HTML heading elements serve the same purpose on a web page.
There are six different elements, ranging from <h1>
representing the most important, down to <h6>
, representing the least important. In practice, the headings <h1>
, <h2
>, and <h3>
are heavily used, but it is often difficult to consistently follow a hierarchical pattern of importance throughout a site for these smaller heading.
Defaults for h1 - h6
A Typical Use of h1 - h3
Paragraphs - <p>
The paragraph element is meant to display some descriptive text or a paragraph. Consecutive paragraphs will have space between them, just like in a book.
Lists - <ul>, <ol>, <li>
Lists will be familiar to you, as you've probably created them in Word or Google Docs. There are two options: ordered and unordered. Each type of list requires the use of the container element to specific what type of list, and the inner elements for each list item.
The ul
element is for an unordered list. The ol
element is used for an ordered list.
Emphasizing Text - <strong>, <em>, <b>, <i>
Element
Usage
strong
indicates that its contents have strong importance, seriousness, or urgency. Browsers typically render the contents in bold type
em
marks text that has stress emphasis
b
is used to draw the reader's attention to the element's contents, which are not otherwise granted special importance
i
represents a range of text that is set off from the normal text for some reason, such as idiomatic text, technical terms, taxonomical designations, among others
Last updated
Was this helpful?