HTML Introduction
HTML, which stands for HyperText Markup Language, is the standard markup language used to create web pages. It forms the skeleton and structure of most web pages we see in browsers every day.
What is HTML?
- HTML is a language that describes the structure of web pages.
- It consists of a series of elements that tell the browser how to display content.
- Elements are represented by tags, such as
<h1>,<p>,<img>, etc.
A Simple HTML Document Example
html
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
</body>
</html>Example Explanation
<!DOCTYPE html>: Declares the document type as HTML5.<html>: The root element of the entire HTML page.<head>: Contains the document's metadata, such as title, character set, etc. This content is not directly displayed on the page.<title>: Sets the page title, which appears in the browser's tab.<body>: Contains all visible content of the web page, such as headings, paragraphs, images, links, etc.<h1>: Defines a main heading.<p>: Defines a paragraph.
Core Concepts
- Tag: A keyword surrounded by angle brackets, such as
<h1>. Tags usually come in pairs, like<h1>(opening tag) and</h1>(closing tag). - Element: Refers to all the code from the opening tag to the closing tag.
- Attribute: Added in the opening tag to provide additional information for the element. For example,
srcandaltin<img src="image.jpg" alt="description">.
HTML is the first step in learning Web development. With it, you can define the content and basic structure of web pages. Next, you will learn CSS to style pages and JavaScript to add interactivity.