HTML stands for Hypertext Markup Language. It is the standard markup language for creating web pages. HTML describes the structure of a web page semantically, including elements like headings, paragraphs, links, images, and more.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Title of the Document</title>
</head>
<body>
<!-- Content goes here -->
</body>
</html>
<!DOCTYPE html>
: Declaration of the HTML version.<html>
: The root element of the HTML document.<head>
: Contains meta-information about the HTML document.<meta charset="UTF-8">
: Specifies the character encoding for the document.<meta name="viewport" content="width=device-width, initial-scale=1.0">
: Sets the viewport for responsive web design.<title>
: Defines the title of the document.<body>
: Contains the content of the HTML document.
HTML elements are the building blocks of HTML pages. They are represented by tags enclosed in angle brackets.
Example:
<p>This is a paragraph</p>
<a href="https://example.com">This is a link</a>
<img src="image.jpg" alt="Description of the image">
<p>
: Paragraph element.<a>
: Anchor element (link).<img>
: Image element.
HTML elements can have attributes that provide additional information about them.
Example:
<a href="https://example.com" target="_blank">This link opens in a new tab</a>
<img src="image.jpg" alt="Description of the image">
href
: Specifies the URL of the link.target="_blank"
: Specifies that the link should open in a new tab.src
: Specifies the source URL of the image.alt
: Specifies an alternate text for an image.
- Headings:
<h1>
to<h6>
- Paragraphs:
<p>
- Links:
<a>
- Images:
<img>
- Lists:
<ul>
,<ol>
,<li>
- Tables:
<table>
,<tr>
,<td>
- Forms:
<form>
,<input>
,<button>
Comments in HTML are used to provide explanations or notes to the code and are not displayed in the browser.
Example:
<!-- This is a comment -->
<p>This is a paragraph</p>
HTML provides the basic structure and content of web pages. Understanding HTML is essential for web development as it forms the foundation upon which websites are built. This overview covers the fundamental aspects of HTML, but there is much more to explore and learn in HTML and web development in general.