HTML - FORMATTING
Headings
There is a special tag for specifying headings in HTML. There are 6 levels of headings in HTML ranging from
<h1>
for the most important, to <h6>
for the least important.
Here they are:
Code | Result |
---|---|
Heading 1Heading 2Heading 3Heading 4Heading 5Heading 6 |
The <strong>
Element
To place a strong importance on a piece of text, use the
<strong>
element.Code | Result |
---|---|
Attention: Please leave the door open. |
The <em>
Element
You can place an emphasis on text by using the
<em>
element.Code | Result |
---|---|
Strawberries are delicious! |
Line Breaks
You can force a line break by using the
<br>
element.Code | Result |
---|---|
Here is a line break. |
Horizontal Rule
You can create a horizontal rule by using the
<hr>
element.Code | Result |
---|---|
Here's a horizontal rule... ...that was a horizontal rule :) |
Unordered (un-numbered) List
To create an unordered list, use the
<ul>
element to define the list, and the <li>
element for each list item.Code | Result |
---|---|
|
Ordered (numbered) List
To create an ordered list, use the
<ol>
element to define the list, and the <li>
element for each list item.
Note, that the only difference between an ordered list and an unordered list is the first letter of the list definition ("o" for ordered, "u" for unordered).
Code | Result |
---|---|
|
We will be covering more HTML elements throughout this tutorial, but before we do that, you should know about attributes.
No comments: