HTML Tags
HTML (HyperText Markup Language) is used to create and design web pages. It consists of various tags that define the structure and content of a webpage. Here’s a basic rundown of some common HTML tags and their purposes:
Basic Tags
-
<!DOCTYPE html>
- Declares the document type and version of HTML.
- Always the first line in an HTML document.
-
<html>
- The root element of an HTML document.
- Contains all other HTML elements.
-
<head>
- Contains meta-information about the document, such as its title and links to stylesheets.
-
<title>
- Sets the title of the document, which appears in the browser’s title bar or tab.
-
<meta>
- Provides meta-information like character set, author, and viewport settings.
- Example:
<meta charset="UTF-8">
-
<link>
- Links to external resources, such as stylesheets.
- Example:
<link rel="stylesheet" href="styles.css">
-
<script>
- Used to define client-side JavaScript.
- Example:
<script src="script.js"></script>
-
<body>
- Contains the content of the document that is visible to the user.
Structural Tags
-
<header>
- Represents introductory content or navigational links.
-
<nav>
- Defines a navigation section with links to other parts of the website.
-
<main>
- Represents the dominant content of the document.
-
<section>
- Defines a section in a document. Often used for grouping related content.
-
<article>
- Represents a self-contained piece of content, like a blog post or news article.
-
<aside>
- Represents content indirectly related to the main content, like a sidebar or a pull quote.
-
<footer>
- Represents the footer of a document or section, typically containing author information, copyright, or contact details.
Text Formatting Tags
-
<h1>
to<h6>
- Defines headings,
<h1>
is the largest, and<h6>
is the smallest.
- Defines headings,
-
<p>
- Represents a paragraph.
-
<strong>
- Indicates strong importance, typically displayed as bold text.
-
<em>
- Indicates emphasized text, typically displayed as italic.
-
<a>
- Defines a hyperlink. Use the
href
attribute to specify the URL. - Example:
<a href="https://example.com">Link Text</a>
- Defines a hyperlink. Use the
-
<br>
- Inserts a line break.
-
<hr>
- Represents a thematic break or horizontal line.
List Tags
-
<ul>
- Defines an unordered list.
<li>
is used to define each list item.
-
<ol>
- Defines an ordered list.
<li>
is used to define each list item.
-
<dl>
- Defines a description list.
<dt>
is used for the term, and<dd>
is used for the description.
Table Tags
-
<table>
- Defines a table.
-
<tr>
- Defines a table row.
-
<td>
- Defines a table data cell.
-
<th>
- Defines a table header cell.
-
<caption>
- Defines a table caption.
Form Tags
-
<form>
- Defines an HTML form for user input.
-
<input>
- Defines an input field. The
type
attribute specifies the input type (e.g., text, password, submit).
- Defines an input field. The
-
<textarea>
- Defines a multiline text input field.
-
<button>
- Defines a clickable button.
-
<select>
- Defines a drop-down list.
-
<option>
- Defines options in a drop-down list.
-
<label>
- Defines a label for an
<input>
element.
- Defines a label for an
This is just a basic overview; there are many more tags and attributes to explore as you dive deeper into HTML.
At Online Learner, we're on a mission to ignite a passion for learning and empower individuals to reach their full potential. Founded by a team of dedicated educators and industry experts, our platform is designed to provide accessible and engaging educational resources for learners of all ages and backgrounds.
Terms Disclaimer About Us Contact Us
Copyright 2023-2025 © All rights reserved.