What is HTML?
HTML is a markup language used to create web pages. It consists of various tags that instruct the browser on how to display text, images, and other elements on the page. Key HTML tags include:
<html>
— indicates the beginning of the document;<head>
— contains meta information such as the page title and linked styles;<body>
— holds the main content of the page.
Structure of an HTML Document
An HTML document always begins with the declaration <!DOCTYPE html>
, which specifies the HTML5 version. Following this are the <html>
tags, containing <head>
and <body>
. The <head>
section includes the page title, meta tags, and links to stylesheets and scripts. The <body>
section contains the main content, such as text, images, and forms.
First Steps in Creating an HTML Document
- Install a simple text editor like Notepad++ or VS Code.
- Create a new file and save it with the
.html
extension. - Write the basic HTML structure:html
<!DOCTYPE html> <html> <head> <title>My First HTML Page</title> </head> <body> <h1>Hello, World!</h1> <p>This is my first website.</p> </body> </html>
- Open the file in a browser and check how it looks.
Important Tags for Beginners
<h1>
–<h6>
— headings of different levels;<p>
— paragraph of text;<a>
— hyperlink;<img>
— image;<ul>
,<ol>
— lists.
Semantic Tags
In addition to basic tags, it’s important to use semantic elements like <header>
, <article>
, <section>
, <footer>
. These help organize the document structure, which is crucial for SEO and page accessibility.
HTML Optimization for SEO
Correct usage of heading tags (H1-H6) helps search engines index your page better. Also, remember to include descriptive meta tags and use alt attributes for images — this will improve your page’s visibility in search engines.