HTML (HyperText Markup Language) – is a markup language used to create web pages. It defines the structure of a document using tags.
Basics of HTML
An HTML document consists of elements that are wrapped in tags. For example:
<!DOCTYPE html>
<html>
<head>
<title>My first page</title>
</head>
<body>
<h1>Hello, world!</h1>
<p>This is my first HTML document.</p>
</body>
</html>
Basic HTML Tags
Headings
To create headings, use the tags <h1> – <h6>:
<h1>This is a level 1 heading</h1>
<h2>This is a level 2 heading</h2>
Paragraphs
The tag <p> is used for text paragraphs:
<p>This is a regular text paragraph.</p>
Links
To create hyperlinks, use the tag <a>:
<a href="https://example.com">Go to the website</a>
Images
To insert an image, use the tag <img>:
<img src="image.jpg" alt="Image description">
Lists
Lists can be ordered (<ol>) and unordered (<ul>):
<ul>
<li>First item</li>
<li>Second item</li>
</ul>
<ol>
<li>First item</li>
<li>Second item</li>
</ol>
HTML is the foundation of any web page. It defines its structure, while styles and scripts help make the site functional. If you are just starting to learn about web development, HTML is the first step. The best way is practice.
How to Create Your First Web Page (Offline)
To create a simple HTML page and view it in a browser, follow these steps:
- Open any text editor (for example, Notepad, VS Code, Sublime Text).
- Create a new file and insert the following code:
<!DOCTYPE html>
<html>
<head>
<title>Offline page</title>
</head>
<body>
<h1>This is my offline page</h1>
<p>This text is displayed in your browser without the internet. The browser reads and interprets the code from your file.</p>
</body>
</html>
- Save the file with the extension
.html, for example,index.html. - Open the folder where the file is saved and double-click on it. It will open in your browser.
If you did everything correctly - you will see the content of your file in the browser.
To be precise - the interpreted content. You will not see the tags, you will see what they are interpreted into.
For example, you will not see this tag on the page:
<title>Offline page</title>
Its content will be visible on the browser's panel (the title of the tab or window).