Below are comprehensive notes for understanding various HTML elements, their usage, and commonly used attributes.
<meta charset="UTF-8">
: Specifies the character encoding for the HTML document.<meta name="viewport" content="width=device-width, initial-scale=1.0">
: Sets the viewport to the width of the device and initial zoom level.<meta http-equiv="X-UA-Compatible" content="ie=edge">
: Instructs the browser to use the latest rendering engine.<meta name="description" content="...">
: Provides a brief description of the HTML document for search engines.<meta name="keywords" content="...">
: Specifies keywords relevant to the HTML document.<meta name="author" content="...">
: Specifies the author of the HTML document.
<header>
: Represents the header of a document or a section.<nav>
: Creates a navigation bar.<ul>
: Unordered list to structure navigation items.<li>
: List items within the navigation menu.
<h1>
to<h6>
: Used for defining headings of different levels.
<p>
: Represents a paragraph of text.
<a>
: Creates hyperlinks.href
: Specifies the URL of the link.
<img>
: Displays images.src
: Specifies the URL of the image.alt
: Provides alternative text for the image.width
: Specifies the width of the image.height
: Specifies the height of the image.
<b>
,<i>
,<u>
: Bold, italic, and underline text respectively.<hr>
: Creates a horizontal line.
<sub>
,<sup>
: Renders text as subscript or superscript respectively.
<pre>
: Displays text exactly as written.
<header>
,<nav>
,<footer>
: Structural elements for header, navigation, and footer sections.<main>
,<section>
,<article>
: Main content and divisions within the document.
<div>
: Used for grouping elements for styling purposes.<span>
: Styles a small part of the text.
<ul>
: Unordered list with bullet points.<ol>
: Ordered list with numbers.<li>
: List items within<ul>
or<ol>
.
<table>
: Creates a table.<tr>
: Represents a table row.<th>
: Represents a table header cell.<td>
: Represents a table data cell.colspan
: Merges cells horizontally.rowspan
: Merges cells vertically.
<form>
: Creates a form to collect user input.action
: Specifies the URL where the form data will be submitted.method
: Specifies the HTTP method for submitting form data (e.g., "get" or "post").for
: Associates a label with a form control.type
: Specifies the type of form control (e.g., "text", "radio", "checkbox", "submit").name
: Specifies the name of the form control.id
: Specifies a unique id for the form control.value
: Specifies the value of the form control.
<iframe>
: Embeds an inline frame.<video>
: Embeds a video clip.<audio>
: Embeds audio content.
<br>
: Inserts a single line break.<hr>
: Creates a thematic break or horizontal rule.<meta>
: Provides metadata about the HTML document.<script>
: Embeds client-side JavaScript code.<style>
: Embeds CSS styles within the HTML document.
These notes provide a comprehensive understanding of HTML elements, their usage, and commonly used attributes in web development.