HTML Introduction
What is HTML?
HTML is the standard language used to create and design web pages. It structures the content on the web by defining elements like headings, paragraphs, links, images, and more.
Basic Structure of an HTML Document
-
Doctype Declaration:
<!DOCTYPE html>
This tells the browser that the document is an HTML5 document.
-
HTML Element:
<html> </html>
This is the root element of an HTML page.
-
Head Section:
<head> <title>Page Title</title> </head>
Contains meta-information about the HTML document, like the title and links to stylesheets.
-
Body Section:
<body> <h1>Main Heading</h1> <p>This is a paragraph.</p> </body>
Contains the content of the web page, such as text, images, and links.
Basic HTML Elements
- Headings:
<h1>
,<h2>
,<h3>
,<h4>
,<h5>
,<h6>
- Paragraphs:
<p>
- Links:
<a href="URL">Link Text</a>
- Images:
<img src="URL" alt="Description">
- Lists:
<ul>
,<ol>
,<li>
- Tables:
<table>
,<tr>
,<td>
,<th>
Example of a Simple HTML Document
<!DOCTYPE html>
<html>
<head>
<title>My First HTML Page</title>
</head>
<body>
<h1>Welcome to My Web Page</h1>
<p>This is a paragraph of text.</p>
<a href="https://www.example.com">Visit Example.com</a>
<img src="example.jpg" alt="Example Image">
</body>
</html>
Tips for Writing HTML
- Use Semantic HTML: Use elements according to their intended purpose (e.g.,
<header>
,<footer>
,<article>
,<section>
). - Validate Your HTML: Use tools like the W3C Markup Validation Service to check for errors.
- Keep It Well-Structured: Indent your code for readability.
Feel free to ask if you need more details or have specific questions about HTML!
At Online Learner, we're on a mission to ignite a passion for learning and empower individuals to reach their full potential. Founded by a team of dedicated educators and industry experts, our platform is designed to provide accessible and engaging educational resources for learners of all ages and backgrounds.
Copyright 2023-2025 © All rights reserved.