About Lesson
- What is HTML?
HTML (HyperText Markup Language) is the standard language used to create and design the structure of web pages. It defines the content and layout of a webpage using elements called tags, which the browser interprets to display text, images, videos, and other multimedia.
Key Features of HTML
- Structure: HTML provides the framework for organizing content like headings, paragraphs, lists, links, and tables.
- Cross-Browser Support: HTML works consistently across different web browsers.
- Media Integration: It allows embedding multimedia elements like images, audio, and videos.
- Interactivity: HTML, combined with CSS and JavaScript, enables dynamic and interactive webpages.
- Structure of an HTML document
- Basic tags:
<html>
,<head>
,<body>
How It Works
An HTML document consists of tags enclosed in angle brackets (
< >
). These tags define elements and attributes to format and structure the page. For example:Explanation
1.
<!DOCTYPE html>
- Declares the document type.
- Tells the browser that the document is written in HTML5.
- It’s not a tag but a declaration required for proper rendering of the page.
2.
<html>
- This is the root element of the HTML document.
- All other tags and content are nested inside this tag.
3.
<head>
- Contains metadata about the HTML document (information not displayed directly on the webpage).
- Example of metadata: the title of the page, links to stylesheets, or scripts.
4.
<title>Welcome</title>
- Specifies the title of the webpage.
- This text appears on the browser tab when the page is open.
- Example: If you visit this webpage, the browser tab will display “Welcome.”
5.
<body>
- Contains the visible content of the webpage.
- Anything inside this tag is displayed to the user in the browser window.
6.
<h1>Hello, World!</h1>
<h1>
is a heading tag, representing the most important heading on the page.- “Hello, World!” will be displayed as a large, bold heading.
- HTML supports six heading levels:
<h1>
to<h6>
, with<h1>
being the largest and most important.
7.
<p>Cyber Tech Creations.</p>
<p>
defines a paragraph.- Displays the text “Cyber Tech Creations.” as a block of text below the heading.
How It Looks in a Browser
- The browser renders “Hello, World!” as a large, bold heading.
- Below it, the browser shows the text “Cyber Tech Creations.” in regular paragraph style.