HTML_Tags_Assignment_Updated
HTML_Tags_Assignment_Updated
What is HTML?
HTML (HyperText Markup Language) is the standard language used to create web pages. It
structures the content on the web by using various tags that define different types of
content and their layout. Each HTML tag has a specific role and helps browsers render
content appropriately.
1. Basic Tags
Basic HTML tags define the general structure and content of a web page. These include:
<html> – The root element that wraps the entire HTML document.
<h1> to <h6> – Heading tags; <h1> is the largest and <h6> is the smallest.
Example:
<html>
<head>
<title>My Page</title>
</head>
<body>
<h1>Welcome</h1>
<p>This is a paragraph.</p>
</body>
</html>
Example:
Example:
<ul>
<li>Apple</li>
<li>Banana</li>
</ul>
<ol>
<li>First</li>
<li>Second</li>
</ol>
4. Table Tags
<table> – Defines the table structure.
Example:
<table>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>Alice</td>
<td>24</td>
</tr>
</table>
5. Form Tags
<form> – Creates an HTML form for user input.
Example:
<form>
<label for='name'>Name:</label>
<input type='text' id='name'>
<br>
<textarea rows='4' cols='30'></textarea>
<br>
<button type='submit'>Submit</button>
</form>
6. Semantic Tags
Semantic tags clearly describe the role of the content within them.
Example:
<header>
<h1>Site Title</h1>
</header>
<nav>
<a href='#'>Home</a>
</nav>
<section>
<article>
<h2>Blog Post</h2>
<p>Content here...</p>
</article>
</section>
<footer>
<p>Copyright 2025</p>
</footer>