HTML is a vital part of the web as we know it. And while few web designers create pages by manually typing HTML, it’s still handy to know a little bit about it.
We’re going to look at some basics of the language, including what HTML really is, some fundamental concepts, and how it interacts with other languages. Think of this as an “HTML for dummies” crash course.
HTML Basics: What Is HTML?
HTML stands for Hypertext Markup Language. And while it’s sometimes lumped in with programming languages, this isn’t accurate.
As a markup language, HTML only lets you create the display layout of pages. A true programming language, like Java or C++, contains logic and commands that are carried out.
While it’s simple, HTML is at the backbone of every page on the web. It’s responsible for what text shows up as bold, adding images, and linking to other pages. We have an HTML FAQ that explains more.
You can right-click on most webpages in your browser and choose View page source or similar to see the HTML behind them. This will likely also contain a lot of code that’s not HTML, but you can sift through that.
Even if you have zero experience with markup or programming languages, learning a bit about HTML will make you a more informed web user. Let’s walk through five basic steps to help you understand how HTML works. We’ll provide examples along the way.
Step 1: Understanding the Concept of Tags
HTML uses a system of tags to categorize different elements of the document.
Most tags come in pairs to wrap the affected text inside them. Here’s a simple example (the tag makes text bold; we’ll discuss this more in a moment.)
This is some bold text.
Notice how the closing tag starts with a forward slash (/). This signifies a closing tag, which is important. If you don’t close a tag, everything from the start onward will have that attribute.
However, not all tags have a pair. Some HTML elements, called empty elements, have no content and exist on their own. An example is the
tag, which is a line break. You can “close” such tags by adding a slash (such as
) but it’s not strictly necessary.
Step 2: The Skeleton HTML Layout
A proper HTML document must have certain tags defined so it’s laid out correctly. These are the essential parts:
- Every HTML document must begin with
to declare itself as such. Thus, its closing tag,