Jan Dvořák

Published 31. May 2022

Updated 22. October 2026

What Is HTML? The Basics You Need to Know to Get Started

Website creation

13 min

Jan Dvořák

Published 31. May 2022

Updated 22. October 2026

Close-up of HTML code in a dark code editor: the doctype, head, title and meta tags
Take the 1st step towards your own website

Register your  domain before someone else takes it. It’s easy and fast! 

Originally published on WY.sk

HTML has long since stopped being just for IT and the people who work in it. Knowing the language comes in handy for anyone who wants to create their own website, whether for personal or work purposes.

In this article, you’ll find the HTML basics: what HTML is, what it involves, and which basic tags and commands are worth knowing.

You don’t need any previous programming experience, because we wrote this guide specifically for people who have never programmed anything and know nothing about web development.

What is HTML?

HTML (HyperText Markup Language) is a markup language you can use to create web pages and documents. It’s a combination of plain text and tags.

People mistakenly call it a programming language, but that’s not what HTML is. The main feature of programming languages (such as JavaScript or PHP) is that they can create conditions like “if x happens, do y.” Since you can’t program with HTML, knowing it only lets you display certain elements (videos, text, images, bullet points and so on) and use them to create a basic web page.

For example, you couldn’t create a login page in HTML, because that would also require programming the login function and a check that the credentials are correct, which is functionality you won’t find in HTML.

What do you need to get started?

All you need is the web browser you normally use and a suitable text editor such as Sublime Text or Notepad++.

Notepad++ window with the HTML code of a simple web page

Example of HTML code in Notepad++

How to create an HTML file

The advantage of HTML files is that all you need to view them is a web browser, and you don’t have to keep them on a server anywhere. You’ll only need web hosting and a domain if you want to make them available online.

To create one, all you have to do is save a text document with the .html extension.

The home page has to be named index.html; you can name the other files as needed, and the file name will also serve as its URL. The index.html file is the one that loads by default if you don’t point the browser to another specific file.

https://www.yourdomain.com -> loads the index.html file

https://www.yourdomain.com/about.html -> loads the about.html file

Register your domain right now

33,000 domains are registered every day. So don’t wait – don’t let someone else snatch yours. 

HTML document structure

HTML as a whole is made up of tags (also known as markup tags), which determine how the individual elements on the page are displayed.

Tags are written in angle brackets, <>, and there are two kinds: paired and unpaired. Paired tags have an opening and a closing tag. The opening and closing tags enclose text or other HTML tags, which appear on your page as instructed. Unpaired tags only have an opening tag and don’t need to be closed at all.

In practice, it looks like this: <tagname>content</tagname>

At the beginning of an HTML document, you should use the unpaired <!DOCTYPE> tag. It’s the document type declaration. The character encoding is declared in the HTML document with the <meta charset="utf-8"> tag. This encoding lets you use the diacritical marks that are part of the Slovak language.

Note for international readers: The remark about diacritics was written for Slovak readers. UTF-8 covers most characters of the vast majority of written languages, and it’s the only valid encoding for HTML5 documents, so you use the same declaration for a page in English or any other language.

The next tag is the paired <html> tag, which marks the beginning and end of the HTML document’s content. All of the document’s content has to be between these two tags. The tag isn’t mandatory, but if you want someone else to be able to find their way around your code in the future, it’s a good idea to write it according to established practices, which most programmers and web developers generally know. At the end, you close it with </html>.

The <head> tag is a paired tag that marks the head of the document. The head isn’t actually displayed on the page, and in the document, it ends with </head>.

All of the page’s content goes into what’s called the body. You mark the body in an HTML document with the paired <body> tag at its beginning and </body> at its end. Inside the body, you can also use other tags, for example to change the background color, insert an image and so on.

The <!-- your note --> tag doesn’t appear on your page, but it can help you find your way around the document quickly. Everything inside this tag is a note. You can use notes to label the individual parts of the document, which gives you a better overview and keeps them in order.

Basic HTML tags

Headings

HTML has as many as six types of headings, which differ from each other in font size. You mark them in the text with paired tags, for example <h1></h1> to <h6></h6>.

Paragraph

The <p> tag marks a paragraph. It’s a formatting tag that opens and closes every new paragraph.

Another paired tag you should use is <title>. This tag, which sits in the document’s head between the <head></head> tags, marks the title, that is, the name of the page, which appears in the browser’s title bar.

<!DOCTYPE html>

<html>
<head>
<title>Page title</title>
</head>

<body>
<h1>Heading on the page</h1>
<p>paragraph text 1</p>
<p>paragraph text 2</p>
</body>
</html>

What’s important to understand about this structure is that nothing in the head section is displayed in the browser, only in the page’s code.

This section most often holds meta tags, such as the meta description for SEO, or analytics code like Google Analytics.

Inside the paragraph tag <p>, you can also use the following tags to change the font:

<b></b>: bold; makes the text bold

<i></i>: italic; the text will be in italics

<strong></strong>: strong; the text inside these tags will also be bold, but this tag puts emphasis on your text. That’s why it’s called a semantic tag.

<small></small>: small; the text will be in a small font

<ins></ins>: this tag marks added text, which is displayed underlined.

<del></del>: this tag marks deleted text and strikes it through. We recommend, though, that you properly remove deleted text from the document.

Links

To create a link to another page, you can use the <a href="URL">link text</a> tag, where “link text” is the text of the link that takes you to the specific page when clicked. In the href attribute, simply enter the link to the page you want to send your readers to.

If you want the link to open in a new window, just add the target="_blank" attribute:

<a href="URL" target="_blank">link text</a>

Creating a list

Start with the <ul> tag, which defines an unnumbered, bulleted list. Inside the <ul> tag, you use <li> tags, which define a list item and its text. For example: <li>your text</li>.

If you want a numbered list instead of bullets, you can write it with the <ol> tag. It will number every item in your list.

For a bulleted list, the HTML code looks like this:

<!-- Lists -->

<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>

If you want numbers instead of bullets, use HTML code like this:

<!-- Lists -->

<ol>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>

Creating a table

Several tags are used to create a table:

  • the paired <table></table> tag
  • put the table’s title inside the <caption></caption> tags
  • you define the table header with the <thead></thead> tags
  • to define the table rows, you can use the <tr></tr> tags
  • you define a table header cell, that is, the content of the main cells, with the <th></th> tags
  • the <td></td> tags define the content of the individual cells

Here’s an example of what the HTML code looks like in practice:

<!-- Table -->

<table>
<tr>
<th>First name</th>
<th>Last name</th>
<th>Age</th>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
<td>30</td>
</tr>
<tr>
<td>Jane</td>
<td>Doe</td>
<td>29</td>
</tr>
</table>

And this is what the table will look like:

First name Last name Age
John Doe 30
Jane Doe 29

Structural tags

With these tags, you can define logical areas within your web page.

The first of them is the page header, the visible top part of the page, which can be marked with the <header></header> tags.

Next, you can use the <footer></footer> tag to mark the page footer. In the footer, you can include information about the owner or creator of the page, as well as the year the page was created.

You use the <main></main> tag to define the page’s main content, but it’s a fairly redundant tag, since it’s mainly informational and doesn’t affect the layout or appearance of the elements on the page. Its content should be unique, and it’s not recommended to put the navigation bar, the logo or the sidebar in it.

To mark a content section, such as a chapter of an article, use the paired <section></section> tag. Just write the text between the tags, and it will appear on your page as that particular chapter. The tag itself doesn’t affect how the page is displayed; it’s mostly there to divide up the code so you can find your way around it more easily.

You can use the <nav></nav> tag to mark the page’s navigation, such as the navigation bar, a menu, an article’s table of contents and so on.

The <details></details> tag encloses a part of the content that users can show or hide. It’s used together with the <summary> and <p> tags. You can see an example here.

Using images

To display images, you use the <img> tag with the src attribute, which sets where the image is located. The image must have its own URL, which means you first need to upload it somewhere: either to your hosting or to a free image hosting service (such as this one). It’s written like this:

<img src="your-image-url.jpg">

If you want a border around the image, use the CSS border property and set the thickness you want.

<img src="your-image-url.jpg" style="border: 2px solid;">.

We recommend trying out several numeric values until you find the border thickness that suits your image.

The image’s height and width can be written like this: <img src="your_image.gif" width="60" height="100">, where the numbers are in pixels.

However, we don’t recommend uploading oversized images and then shrinking them to the size you need with HTML code. That could make your page load more slowly. Instead, resize the image to the height and width you need before you add it to the page.

Other HTML tags

If you write your own blog and want to use quotations in it, you add them with the paired <blockquote></blockquote> tag.

The <blockquote cite="http://yourexample.com"> tag records the URL of the document the passage you’re quoting comes from.

Another interesting tag is <abbr>, which lets you define abbreviations on your pages. It’s written like this: <abbr title="Description of the abbreviation">ABBREVIATION</abbr>, and on the page it looks like this:

When you hover over HTML, you’ll see what the abbreviation means >>> <abbr title="This is an article about HTML">HTML</abbr>.

The <button></button> tag creates a button, and you can put other HTML code inside it. Within this tag, you can define the name and the text, insert images and so on. Example: <button name="anything" value="anything">button <b>subscribe and learn more</b></button>

For more advanced uses of this tag, though, you’ll need programming skills, especially if clicking the button should send some data.

Styling content in HTML documents with CSS properties

Inside the “body” tag, you can also use the following CSS properties, which let you adjust the basic look of the content on your page with the style attribute.

Background color

background-color: changes the background color. You can write the color you choose as a word or as a HEX code, which has six characters and a # at the beginning of every color code.

Text alignment

To align text, you use the text-align property (left, right, center or justify), which aligns a paragraph and the text in it to the side you choose. It’s written like this:

<p style="text-align: right">your text</p>

Text color

If you decide to change the color of your text, use the color property. You can define the color the same way as the background color: with a word or with the color’s HTML code.

Text size

Besides the color of your text, you can also change its size. You can define the font size in pixels, percentages, millimeters, inches and so on. To change it, use the font-size property.

The code to change the text color and size looks like this:

<p style="color: #999999; font-size: 16px;">your text</p>

Final thoughts

We hope this article has helped you understand the logic of HTML and how to create HTML files, and has explained the basic tags to get you started.

Tip 1: If you want to see the HTML code of your page, press Ctrl+U to display the page’s source code.

Tip 2: You’ll find many online HTML editors that generate the code for you once you add the elements and content you want. We recommend trying html-online.com, for example.

Frequently Asked Questions (FAQ)

What does HTML stand for?

HTML stands for HyperText Markup Language. It’s a markup language you can use to create web pages and documents, and it combines plain text with tags that determine how each element on the page is displayed.

Is HTML a programming language?

HTML isn’t a programming language but a markup language. Programming languages such as JavaScript or PHP can create conditions like “if x happens, do y,” while HTML only displays elements such as text, images and videos. That’s why you can’t create a login page in HTML: checking the credentials requires programming.

What is HTML used for?

HTML is used to create web pages and documents. Its tags tell the browser which elements to display and how, from headings, paragraphs and images to links, lists and tables. Knowing HTML comes in handy for anyone who wants to create their own website, whether for personal or work purposes.

How do you create an HTML file?

To create an HTML file, save a text document with the .html extension in a text editor such as Sublime Text or Notepad++. Name your home page index.html. You can open the file in your web browser, and you only need web hosting and a domain if you want to put it online.

How do you add an image in HTML?

To add an image in HTML, use the <img> tag with the src attribute, which points to the image’s URL: <img src="your-image-url.jpg">. The image has to be uploaded first, to your hosting or to a free image hosting service. Resize it to the width and height you need before you add it, because shrinking an oversized image with HTML could slow down your page.

How do you center text in HTML?

To center text in HTML, add the CSS property text-align with the value center to the paragraph’s style attribute: <p style="text-align: center">your text</p>. The same property also aligns text left, right or justified.

Jan Dvořák

At Webglobe, I look after the blog, the websites, SEO and GEO, and I also come up with creative campaigns. Working at a hosting company, I see first-hand where people most often run into trouble with their websites, and that's exactly what I write about. Over the years, this has turned into more than 500 articles, case studies and e-books. If you're dealing with online marketing, visibility in Google and AI search, or a WordPress website, you'll find practical answers in them.

See more of my articles

Sign up for our newsletter You have subscribed to our newsletter

Receive interesting offers, news, guides and articles directly from us. Your e-mail has been added successfully.
The field is required with the correct e-mail format