You are on page 1of 1


♥ iLoveCoding
HTML Cheatsheet
Comprehensive video course on HTML & CSS

Commonly used
1 Syntax to write an HTML element 2 Basic markup of every HTML page 3
HTML elements
Opening Tag Attribute and its value
Every element has an (optional) <!DOCTYPE html> <h1> ... <h6>
opening tag with the name Attributes are like options <html lang="en"> <p>
of the element at its start. of an element. Attributes
have value.
....<head> <i> <strong>
<a> title here
<name attr="value"> ........</title> <div>
....children ....</head> <span>
....<body> lists:
Children (optional) ....
<ul> <ol> <li>
Closing Tag Between the opening and ....
closing tags are the children of
A closing tag has the
the element. This can be more
.... page content
name of the element
with a forward slash elements or just plain text. .... goes here Special formatting
"/" before it. .... <blockquote> <pre>
<name attr="value"/> ....</body>
<img /> <video>
Self-Closing Tag
Some elements that do not have children do not need a closing Code Formatting <audio>
tag. In this case a forward-slash "/" is added to the element's For good code formatting,
opening tag to denote a self-closing tag. remember to indent the
children by 2 or 4 spaces. separators:
Some examples of self-closing elements are:
<hr /> <br />
img, br, hr, meta, input ....

By Aziz Ali ~