What is HTML?
HTML stands for HyperText Markup Language. It is the standard markup language used to create web pages. HTML is used to define the structure of web content.
HTML consists of elements that describe different parts of a web page, such as headings, paragraphs, links, images, and more.
HTML Elements
An HTML element is defined by a start tag, content, and an end tag. For example:
<p>This is a paragraph.</p>
In the above example:
- <p> is the start tag.
- This is a paragraph. is the content.
- </p> is the end tag.
HTML Document Structure
An HTML document typically starts with a DOCTYPE declaration, followed by the <html>
tag, which contains the entire document structure.
A basic HTML document looks like this:
<!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <h1>This is a Heading</h1> <p>This is a paragraph.</p> </body> </html>
Basic HTML Elements
Headings
HTML provides six levels of headings, from <h1>
to <h6>
. For example:
<h1>Heading 1</h1> <h2>Heading 2</h2> <h3>Heading 3</h3>
Paragraphs
Use the <p>
tag to define paragraphs:
<p>This is a paragraph.</p>
Links
Use the <a>
tag to create hyperlinks:
<a href="https://www.w3schools.com">Visit W3Schools</a>
Images
Use the <img>
tag to embed images:
<img src="https://www.w3schools.com/images/w3schools_green.jpg" alt="W3Schools Logo" width="300">