HTML Basics
HTML is like the building blocks of the web. Think of it as the blueprint for creating web pages. When you visit a website, everything you see, like text, images, buttons, and links, is made possible by HTML.
What is HTML?
HTML stands for HyperText Markup Language. It’s a coding language used to structure content on the web. It tells the browser (like Chrome or Firefox) how to display content. Even though HTML is a “language,” it’s not like English or Spanish—it’s more like a set of instructions.
The Basics of HTML
HTML uses something called “tags” to define parts of a web page. These tags are written in angle brackets, like this: <tag>
. Tags usually come in pairs: an opening tag and a closing tag. The closing tag has a slash (/
) before the name, like this: </tag>
.
Here are some basic tags you’ll use in almost every web page:
<html>
: This is the root tag. It tells the browser that everything between<html>
and</html>
is part of an HTML document.<head>
: This tag contains meta-information about the webpage, like the title and links to stylesheets or scripts. It doesn’t show up on the page itself.<title>
: Inside the<head>
, this tag sets the title of the web page, which appears on the browser tab.<body>
: This is where all the content you see on the page goes—text, images, videos, etc. Everything between<body>
and</body>
will be displayed on the web page.<h1>
to<h6>
: These tags are used for headings.<h1>
is the biggest, like the title of a section, while<h6>
is the smallest.<p>
: This stands for paragraph. It’s used to add blocks of text.<a>
: This is the anchor tag, used to create hyperlinks. It lets you link to other pages or websites.<img>
: This tag is used to add images to your page. Unlike most tags,<img>
doesn’t need a closing tag.<div>
: This is a division tag used to group sections of content together, so you can style them later with CSS (a different language that makes your website look good).
A Simple Example
Here’s a basic HTML structure:
<!DOCTYPE html>
<html>
<head>
<title>My First Webpage</title>
</head>
<body>
<h1>Welcome to My Website!</h1>
<p>This is my first paragraph of text.</p>
<img src="image.jpg" alt="A cool image">
<a href="https://www.example.com">Click here to visit Example.com</a>
</body>
</html>
How to Practice HTML
You can start experimenting with HTML on your own computer using a simple text editor like Notepad (Windows) or TextEdit (Mac). Just save your file with a .html
extension (like myfirstpage.html
), and you can open it in any web browser to see your page in action!
If you want a more interactive way to learn, there are websites like Codecademy or Khan Academy that offer free HTML tutorials with live coding exercises.
Why Learn HTML?
Understanding HTML is like learning the foundation of a house. Even if you don’t become a web developer, knowing how to read and write basic HTML can help you customize your blog, build simple websites, or even understand how the internet works a little better. Plus, it’s a great stepping stone to learning more advanced coding languages like CSS or JavaScript.
So, have fun with it, and remember—every cool website you’ve ever visited started with simple HTML just like this!