HTML Introduction
About HTML
- HTML stands for Hyper Text Markup Language
- HTML is used to create web pages
- HTML is the standard language used to define the structure and content of a webpage
Hypertext: Text that functions as a clickable link, directing users to another page or resource
Markup: Special symbols or tags that define the structure of content and guides the browser on how to present it
Language: The set of rules or syntax used to write code, similar to the grammar of a spoken language
HTML Doucment Structure
<!DOCTYPE html>
<html >
<head >
<title> Page Title </title>
</head >
<body >
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
Definitions:
-
<!DOCTYPE html>: Declares that the document is written in HTML5.
-
<html>: The root element that wraps the entire HTML page.
-
<head>: Contains meta-information about the page, like character encoding, styles, and scripts.
-
<title>: Sets the title of the page, which appears in the browser tab or title bar.
-
<body>: Holds all the visible content of the page, including headings, paragraphs, images, links, tables, lists, and more.
-
<h1>: Defines a main heading, usually the largest on the page.
-
<p>: Represents a paragraph of text.
HTML Element
<!DOCTYPE html>: Declares that the document is written in HTML5.
<html>: The root element that wraps the entire HTML page.
<head>: Contains meta-information about the page, like character encoding, styles, and scripts.
<title>: Sets the title of the page, which appears in the browser tab or title bar.
<body>: Holds all the visible content of the page, including headings, paragraphs, images, links, tables, lists, and more.
<h1>: Defines a main heading, usually the largest on the page.
<p>: Represents a paragraph of text.
An HTML element is defined by a start tag, some content, and an end tag:
Syntax:
<tagname> Content of the element </tagname>
Examples:
<h1>My First Heading</h1>
<p>My first paragraph.</p>