HTML-Introduction
{{richtext}:HTML}
HTML- Introduction
My First Web Page
Hello, World!
This is a simple example of an HTML document.
- Item 1
- Item 2
- Item 3
My Website
Welcome to My Website
This is some text.
Link to example.com
HTML (Hyper Text Markup Language) is the foundation of web development. Using a tag-based system, it structures content on the internet. Basic elements like <h1>
for headings and <p>
for paragraphs submitted information. HTML, along with CSS and JavaScript, forms the core trio, enabling the creation of interactive and visually appealing websites.
HTML, or Hypertext Markup Language, is the backbone of web development, serving as the standard markup language for creating and structuring content on the World Wide Web. It uses a system of tags to define different elements within a document, allowing browsers to interpret and display content in a user-friendly manner. In this introduction, we’ll explore key HTML concepts with examples to help you grasp the basics.
1. Document Structure:
Every HTML document starts with a declaration and contains a hierarchical structure. Here’s a minimal HTML document:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My First HTML Page</title>
</head>
<body>
<h1>Hello, World!</h1>
<p>This is a simple HTML page.</p>
</body>
</html>
<!DOCTYPE html>
: Declares the HTML5 document type.<html lang="en">
: The root element, indicating the document’s language (English in this case).<head>
: Contains metadata, like character set and viewport settings.<meta charset="UTF-8">
: Specifies the character encoding.<meta name="viewport" content="width=device-width, initial-scale=1.0">
: Ensures proper scaling on different devices.<title>
: Sets the document title.<body>
: Contains the visible content of the document.<h1>
and<p>
: Headings and paragraphs.2. Headings and Paragraphs:
HTML provides heading tags (
<h1>
to<h6>
) and paragraph tags (<p>
) to structure text:- <h1>Main Heading</h1> <h2>Subheading</h2> <p>This is a paragraph of text. It can contain <strong>strong</strong> or <em>emphasized</em> text.</p>
<strong>
: Represents strong importance, typically displayed as bold.<em>
: Represents emphasized text, typically displayed as italic.
3. Lists:
HTML supports ordered (<ol>
) and unordered (<ul>
) lists, along with list items (<li>
):
<ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> <ol> <li>First</li> <li>Second</li> <li>Third</li> </ol>
4. Links:
Create hyperlinks using the <a>
(anchor) tag:
<a href="https://www.example.com" target="_blank">Visit Example.com</a>
href
: Specifies the URL.target="_blank"
: Opens the link in a new tab or window.
5. Images:
Embed images using the <img>
tag:
src
: Specifies the image source.alt
: Provides alternative text for accessibility.
6. Forms:
Forms are used for user input. Here’s a simple example:
<form action="/submit" method="post">
<label for="username">Username:</label>
<input type="text" id="username" name="username">
<br>
<label for="password">Password:</label>
<input type="password" id="password" name="password">
<br>
<input type="submit" value="Submit">
</form>
action
: Specifies where the form data should be sent.method
: Defines the HTTP method (e.g., “post” or “get”).
HTML, or Hypertext Markup Language, is the foundation of web development, providing a standardized way to structure and present content on the internet. It utilizes a system of tags to define elements within a document, such as headings, paragraphs, lists, links, and images. Each tag carries a specific purpose, contributing to the overall organization and visual layout of a webpage.
HTML documents begin with a declaration (<!DOCTYPE html>
) followed by the root element (<html>
), containing sections like <head>
for metadata and <body>
for visible content. Tags like <h1>
to <h6>
denote headings, while <p>
signifies paragraphs. Lists are created with <ul>
(unordered) and <ol>
(ordered) paired with <li>
for list items. Links are established with the <a>
tag, and images are embedded using <img>
.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.