HTML, which stands for Hypertext Markup Language, is the standard markup language used for creating web pages and web applications. It provides a structure for organizing content on the web and is composed of HTML elements and tags.
Here are the basic components and structure of an HTML document:
Document Type Declaration (DTD):
- The first line of an HTML document is the DTD declaration, which specifies the version of HTML being used. For example:
<!DOCTYPE html>
- The first line of an HTML document is the DTD declaration, which specifies the version of HTML being used. For example:
HTML Tag:
- The
<html>
tag is the root element of an HTML document. It contains all other elements and tags in the document.
- The
Head Section:
- The
<head>
section of the document is used to define meta-information about the document, such as the title, character encoding, linked stylesheets, and scripts. It does not contain visible content.
- The
Title:
- The
<title>
tag is placed within the<head>
section and specifies the title of the web page. The title is displayed in the browser's title bar or tab.
- The
Body Section:
- The
<body>
tag contains the visible content of the web page, such as text, images, links, and other elements.
- The
Heading Tags:
- HTML provides six levels of headings,
<h1>
to<h6>
, where<h1>
represents the highest level and<h6>
represents the lowest level of heading.
- HTML provides six levels of headings,
Paragraphs:
- Paragraphs are represented using the
<p>
tag. It is used to define blocks of text.
- Paragraphs are represented using the
Links:
- Links are created using the
<a>
tag. Thehref
attribute specifies the destination URL or the target location within the same document.
- Links are created using the
Images:
- Images are inserted using the
<img>
tag. Thesrc
attribute specifies the path to the image file.
- Images are inserted using the
Lists:
- HTML supports both ordered (numbered) and unordered (bulleted) lists. Ordered lists are created using the
<ol>
tag, while unordered lists are created using the<ul>
tag. List items are represented with the<li>
tag.
- HTML supports both ordered (numbered) and unordered (bulleted) lists. Ordered lists are created using the