HTML Basics
HTML Basics
What is HTML?
HTML (HyperText Markup Language) is the standard markup language for creating web pages and
web applications. It describes the structure of a web page using elements represented by tags.
HTML Structure
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
Attributes
Attributes provide additional information about an element. They are defined in the opening tag and
Example:
Lists
HTML provides two types of lists:
Example:
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
Tables
Tables are used to display data in rows and columns.
Example:
<table>
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td>Data 1</td>
<td>Data 2</td>
</tr>
</table>
Forms
Forms are used to collect user input.
Example:
<form action='/submit'>
<label for='name'>Name:</label>
</form>