HTML - Notes
HTML - Notes
by : Emmersive Learning
HTML (HyperText Markup Language), which is the standard language for creating webpages.
Here's a structured guide to help you learn HTML:
1. Introduction to HTML
HTML is used to create the structure of web pages. HTML elements are represented by tags.
Every HTML document has a basic structure that includes doctype declaration, html, head, and
body tags.
html
—--------------------
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,
initial-scale=1.0">
<title>Document Title</title>
</head>
<body>
<!-- Content goes here -->
</body>
</html>
—------------------
● <!DOCTYPE html>: Declares the document type and version of HTML.
● <html>: The root element of the HTML document.
● <head>: Contains meta-information about the document (like title, character set, styles,
etc.).
● <body>: Contains the content of the document.
HTML elements are defined by tags. Tags usually come in pairs: an opening tag <tag> and a
closing tag </tag>.
●
● Lists: Define lists.
Unordered List:
Html
Code :
<ul>
<li>List item 1</li>
<li>List item 2</li>
</ul>
Ordered List:
html
Code:
<ol>
<li>List item 1</li>
<li>List item 2</li>
</ol>
<table>
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td>Data 1</td>
<td>Data 2</td>
</tr>
</table>
5. Attributes
Attributes provide additional information about HTML elements. They are always included in the
opening tag and come in name/value pairs.
Example:
html
Code :
In this example, href and target are attributes of the <a> tag.
6. Forms
html
Code :
<label for="email">Email:</label>
<input type="email" id="email" name="email">
7. Semantic HTML
Semantic HTML introduces meaning to the web page rather than just presentation.
<header>
<h1>Website Header</h1>
</header>
<nav>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#about">About</a></li>
</ul>
</nav>
<main>
<article>
<h2>Article Title</h2>
<p>Article content goes here.</p>
</article>
</main>
<footer>
<p>Website Footer</p>
</footer>
Code :
<section>
<h2>Section Title</h2>
<p>Section content goes here.</p>
</section>
<article>
<h2>Article Title</h2>
<p>Article content goes here.</p>
</article>
<aside>
<h2>Aside Title</h2>
<p>Aside content goes here.</p>
</aside>
<footer>
<p>Footer content goes here.</p>
</footer>
9. Best Practices