HTML Cheatsheet Skillcrush
HTML Cheatsheet Skillcrush
A COUPLE NOTES
STRUCTURAL
HEADLINES
Attributes
Some tags have attributes that you have to use. For
example, <a> tags need links in their href attribute.
<h1>...</h1>
Most important headline. Great for
logos, page titles, etc.
META
<!doctype html> MUST HAVE
Tells the computer that its looking at an HTML
page. Put this at the top of your HTML document.
<meta charset=utf-8> MUST HAVE
Tells the computer that you are using the UTF-8
character set (which is the character set for most
of the world wide web). Guards against your site
turning into gibberish.
<title>..</title> MUST HAVE
Gives your site a title in the top of the browser bar.
<script src=http://www.example.com/
scripts/myjavascript.js></script>
Links to external JavaScript files via the src
attribute.
<link rel=stylesheet href=http://www.
example.com/css/stye.css>
Links to external stylesheets via the href attribute.
Use the rel attribute to tell the computer that this
is a stylesheet.
CONTENT
<div></div>
The workhorse of the HTML tags. Use divs for
your different site sections, sidebars, footers, etc.
<p>...</p>
Use for paragraphs!
<img src=http://www.example.com/image/
image.jpg alt=My Image /> SELF-CLOSING
Adds images to your site. Put the image link in the
src attribute and the name in the alt attribute.
<h2>...</h2>
Second most important headline.
Use for article headlines or headlines
for major sections of the page.
<h3>...</h3>
Third most important headline. Use for less
important articles or other secondary content.
<h4>...</h4>
Fourth most important headline.
Good for sidebars and footers.
<h5>...</h5>
Fifth most important headline.
<h6>...</h6>
Sixth most important headline.
TABLES
<ul>...</ul>
Unordered lists, perfect for bulleted lists and such.
<table></table>
Use this tag to add tables to your site.
<ol>...</ol>
Ordered lists, good for numbered or alphabetical lists.
<thead></thead>
Denotes the table head, where you put your
columns names.
<li>...</li>
Each list item goes inside of an li tag.
INLINE ELEMENTS
<a href=http://www.example.com>...</a>
Adds links to external sites via the href attribute.
<span>...</span>
Span tags allow you to group inline elements.
<strong>...</strong>
Use to make sections of your text bold.
<em>...</em>
Use these to make portions of your text italic.
<th></th>
Use these tags inside your table head to give each
column a name.
<tbody></tbody>
Denotes the table body, where all the tabular data
goes.
<tr></tr>
Use this tag to denote a table row.
<td>...</td>
Put each piece of data inside of a data cell, inside of
your table row, inside of your table body.
skillcrush.com