HTML BASIC TAGS
HTML has a variety of basic tags that are fundamental to structuring content on a webpage. Here are some of the most commonly used basic HTML tags:
Document Structure:
The <html>
tag serves as the root element of an HTML document, encapsulating the entire content. Inside it, the <head>
tag contains meta-information about the document, and the <title>
tag sets the title displayed in the browser's title bar or tab. The actual content of the webpage resides within the <body>
tag.
Text Formatting:
To structure text, the <p>
tag defines paragraphs, while heading tags <h1>
to <h6>
represent headings of different levels. The <strong>
or <b>
tags are used for bold text, and <em>
or <i>
tags for italicizing. For underlining text, the <u>
tag can be applied, although it's often recommended to use CSS for styling purposes.
Lists:
HTML provides tags for creating lists: <ul>
for unordered (bullet) lists, <ol>
for ordered (numbered) lists, and <li>
for individual list items.
Links:
The <a>
tag defines hyperlinks. It includes an href attribute, specifying the URL of the linked resource. This tag enables navigation between pages and websites.
Images:
For embedding images, the <img>
tag is used. It requires the src attribute, indicating the source URL of the image, and the alt attribute, providing alternative text for accessibility purposes.
Tables:
Tables are created using the <table>
tag, with <tr>
defining rows, <th>
for header cells, and<td>
for data cells. The optional <caption>
tag provides a title or caption for the table.
Forms:
The <form>
tag is employed to create HTML forms. Various input elements such as <input>
, <textarea>
, <select>
, and <button>
facilitate the collection and submission of user data.
Semantic Markup:
Semantic tags like <div>
and <span>
are generic containers that help structure and style content. HTML5 introduces semantic tags such as <header>
, <footer>
, <nav>
, <section>
, <article>
, and <aside>
for more specific structuring of document sections, enhancing the clarity and meaning of the content.