Welcome to the world of web development! Today, you'll learn the fundamentals of the internet and how web pages are structured using HTML, the language that builds websites. You'll create your very first webpage, understanding the basic building blocks and how to display text and headings.
The World Wide Web (WWW) is a system of interconnected documents, images, and other resources, accessed through the internet. Think of it like a giant library where information is stored on servers (computers that provide information) and accessed by your browser (like Chrome, Firefox, or Safari) on your device. When you type a website address (like www.google.com
), your browser sends a request to the server, which then sends the website's files back to your browser to display. The language that makes these files display in a human-readable format is HTML.
HTML stands for HyperText Markup Language. It's the foundation of every webpage. It uses 'tags' to structure content. Tags are keywords enclosed in angle brackets like <h1>
or <p>
.
Let's look at a basic HTML structure:
<!DOCTYPE html>
<html>
<head>
<title>My First Webpage</title>
</head>
<body>
<h1>Hello, World!</h1>
<p>This is my first paragraph.</p>
<b>This text is bold.</b>
</body>
</html>
<!DOCTYPE html>
: This declares the document as HTML5.<html>
: The root element; everything else goes inside this.<head>
: Contains metadata about the webpage (like the title, which is shown in the browser tab).<title>
: Sets the title of the webpage.<body>
: Contains the visible content of the webpage (headings, paragraphs, images, etc.).<h1>
: Defines a main heading.<p>
: Defines a paragraph.<b>
: Defines bold text.Here are some essential HTML tags:
<h1>
to <h6>
: Heading tags (from largest to smallest). Use headings to structure your content logically.<p>
: Paragraph tag. Use this to create paragraphs of text.<b>
: Bold text. Emphasizes text.<i>
: Italic text. Emphasizes text.<a>
: Anchor tag. Used to create hyperlinks (links to other pages or sections within the same page). Example: <a href="https://www.example.com">Visit Example</a>
.<img/>
: Image tag. Used to display images. Requires the src
(source) attribute to specify the image URL. Example: <img src="image.jpg" alt="Description of the image">
(the alt
attribute provides alternative text for screen readers or if the image fails to load).All tags generally come in pairs (opening and closing tags), except for a few like the image tag (<img/>
) which are self-closing.
.html
extension (e.g., myfirstpage.html
). Make sure to save it as "All Files" or "Plain Text" (depending on your editor) to prevent the editor from adding a .txt
extension.Explore advanced insights, examples, and bonus exercises to deepen understanding.
Congratulations on taking your first steps into web development! You've learned the fundamentals of HTML and how it shapes the content you see on the web. This extended lesson will delve deeper into HTML, explore different ways to organize your content, and give you a taste of how websites interact with the wider world.
Beyond the basics (<h1>
, <p>
, and <b>
), HTML offers a vast array of tags to structure your content. Think of them as different containers and formatting tools. Understanding these tags is crucial for building well-organized and accessible web pages.
<ul>
(unordered list, bullet points) and <ol>
(ordered list, numbered) with <li>
(list item) to create organized lists. Consider the semantic meaning β is the order of the items important?
<em>
(emphasized text, usually italicized) for general emphasis and <strong>
(important text, usually bold) to indicate stronger significance. Choose based on the *meaning* you want to convey.
<img>
tag. Key attributes include src
(source, the image's URL), alt
(alternative text, for accessibility and if the image fails to load), and often width
and height
for layout control. Remember good image optimization practices for site performance!
<a>
tag (anchor). The href
attribute (hypertext reference) specifies the destination URL. For example: <a href="https://www.example.com">Visit Example.com</a>
<!-- Your comment here -->
) to add notes to yourself or other developers within the code. Comments are ignored by the browser and don't affect the rendered page.
Experimenting with these tags will significantly expand your ability to structure and present information on your web pages.
Put your new knowledge to the test with these exercises:
<ul>
) listing your top three favorite things. Each item should be a <li>
within the list. Include a heading (<h2>
or <h3>
) above the list.
<img>
tag. Add the `alt` attribute with a descriptive description of your image. Also, create a link (<a>
) to your favorite website, using the href
attribute.
<em>
and <strong>
tags to emphasize a few words to convey their importance. Example: "This is a very important concept, so pay careful attention."
HTML isn't just for complex websites; it underpins almost everything you see online. Think about these examples:
Understanding HTML provides a fundamental insight into how the web functions and how information is displayed.
Try this advanced exercise: Research and incorporate an HTML table (<table>
, <tr>
, <th>
, <td>
tags) into your webpage to display some data in a structured format (e.g., a table of contents, a list of your skills, or a simple schedule).
This is just the beginning! Continue your exploration with these topics:
<article>
, <aside>
, <nav>
, <footer>
) for better structure and SEO.
Keep practicing, experimenting, and building! The more you work with HTML, the more comfortable and creative you'll become.
Create a webpage with your name as the main heading (`<h1>`). Add a paragraph describing your favorite hobby. Use the `<b>` tag to make a word in the paragraph bold.
Add a link (using the `<a>` tag) to Google. Make the link say 'Search Google'. When clicked, it should open the Google homepage.
Create a webpage with headings from `<h1>` to `<h6>` to see how their sizes change. Include a paragraph below each heading.
Write down three new things you learned about HTML and web development today. How does this new information relate to how you use the internet every day?
Imagine you want to create a personal online resume. Start by sketching out the different sections you want to include (e.g., Contact Information, Education, Skills, Experience). Then, use HTML to create the basic structure of your resume, using headings for each section and paragraphs for the content. This will give you a good foundation for a real-world project you can expand upon.
In the next lesson, we'll dive into CSS (Cascading Style Sheets) to learn how to style your webpages and make them look more visually appealing. Familiarize yourself with HTML tags and try to find some websites you like and analyze their structure (inspect element in your browser can help!).
We're automatically tracking your progress. Sign up for free to keep your learning paths forever and unlock advanced features like detailed analytics and personalized recommendations.