HTML Cheat Sheet - HTML Elements List Reference
HTML Cheat Sheet - HTML Elements List Reference
<!DOCTYPE html>
<html lang="en">
<head>
<title> My HTML Cheat Sheet </title>
</head>
<body></body>
</html>
<!DOCTYPE html> specifies that we are working with an HTML5
Forum Donate
document.
Learn to code — free 3,000-hour curriculum
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-sc
<link rel="stylesheet" href="style.css" />
<title>My HTML Cheat Sheet</title>
<style>
* {
font-size: 100px;
}
</style>
<script>
alert('This is an alert');
</script>
</head>
The <div> tag can be used to divide and style separate sections of
the document. It also acts as a parent container for other elements.
Here's how it works:
<div class="newsSection">
<h1> This is the news section </h1>
<p> Welcome to the news section! </p>
</div>
<div class="contactSection">
<h1> This is the contact us section </h1>
<p> Hello world! </p>
</div>
We also have the <span> tag. This is similar to <div> but you use it
as an inline container.
<p> I love <span class="keyword"> coding! </span></p>
Forum Donate
There's the <br/> tag, which we use for creating line breaks. This
has no closing tag.
Images in HTML
In HTML, we use the <img/> tag to display images.
Text Formatting
Learn to code — freein HTML
3,000-hour curriculum
We have many ways to format text in HTML. Let's go over them now
briefly.
Links
The <a> tag, also known as the anchor tag, is used to define
hyperlinks that link to other pages (external web pages included) or
to a section of the same page.
href specifies the URL the link takes the user to when
clicked.
Learn to an
The <ol> tag defines code — free 3,000-hour
ordered curriculum
list while the <ul> tag defines an
unordered list.
Forms
The <form> tag is used to create a form in HTML. Forms are used to
get user inputs. Here are some attributes associated with the
<form> element:
<select id="age">
<option value="15-18">15-18</option>
<option value="19-25">19-25</option>
<option value="26-30">26-30</option>
<option value="31-36">31-36</option>
</select>
</form>
Tables
The <table> tag defines a HTML table.
<table>
<thead>
<tr>
<th> Course </th>
<th> Progress </th>
</tr>
</thead>
<tbody>
<tr>
<td> HTML </td>
<td> 90% </td>
</tr>
Forum Donate
<tr>
Learn to code — free 3,000-hour curriculum
<td> CSS </td>
<td> 80% </td>
</tr>
</tbody>
<tfoot>
<tr>
<td> JavaScript </td>
<td> 95% </td>
</tr>
</tfoot>
</table>
<header>
<h1> Welcome </h1>
<h3> Hello World! </h3>
</header>
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">About us</a></li>
</ul>
</nav>
<article>
<aside>
<p> It's sunny today </p>
</aside>
</article>
Conclusion
In this article, we have seen a lot of HTML tags, elements, and
attributes commonly used by developers. This is not all there is, but
should serve as a good reference resource.
I hope you found this helpful. Thank you for reading. Forum Donate
If you read this far, thank the author to show them you care.
Say Thanks
InterServer
Open
Our mission: to help people learn to code for free. We accomplish this by creating thousands of
videos, articles, and interactive coding lessons - all freely available to the public.
Donations to freeCodeCamp go toward our education initiatives, and help pay for servers,
services, and staff.
Mobile App
Our Charity
About Alumni Network Open Source Shop Support Sponsors Academic Honesty