Contents
Introduction to HTML
HTML, or HyperText Markup Language, is a markup language that plays a key role in the creation of web pages. This language serves to inform the browser how the content of the page should be displayed. HTML uses special tags to denote various elements, such as headings, images, paragraphs, and buttons. For example, the tag <span>
is used to start a new paragraph, while </span>
is used to end it.
It is important to note that HTML is not a programming language like JavaScript or Python. It does not perform calculations or define functions. HTML can only show how a page should look but does not allow for functionality based on algorithms. To see the HTML code of any webpage, you just need to use a keyboard shortcut: on iOS devices, it's Cmd + Option + U
, and on Windows, it's Ctrl + U
.
Why HTML is Needed
HTML is an essential tool for creating web pages. Without it, web content would be represented as plain text without any structure, making it extremely difficult to perceive. The main reasons to use HTML include:
- SEO: A proper structure of HTML code contributes to better ranking of the site in search engines. Effective use of meta tags, headings, and image attributes can improve page indexing.
- Integrability: HTML works well in conjunction with other web technologies like CSS and JavaScript. HTML defines the structure, CSS handles the style, and JavaScript adds interactivity.
- Universality: HTML is supported by all modern browsers, making it a universal language for creating sites compatible with various devices and platforms.
- Development: HTML is constantly evolving. With each update, new features are added, such as improved support for multimedia and interaction with web applications in modern versions, like HTML5.
Some consider XML an alternative to HTML; however, these languages have different purposes. HTML is intended for visualizing content, while XML is used for storing and transmitting data.
Basic HTML Elements
Each HTML page consists of many elements enclosed in tags. A tag is a special command that marks the beginning and end of an element on the page. The basic HTML tags include:
<html>
— indicates that the document is an HTML page. This tag may contain the attributelang
, which specifies the language of the content.<head>
— contains meta-information about the webpage that is not displayed on the screen but is important for browsers and search engines. Inside this tag are:<meta>
— meta tags for specifying encoding, description, and keywords.<title>
— the title of the page displayed on the browser tab.<link>
— for linking external files, such as CSS.<script>
— for linking external or embedded JavaScript scripts.<body>
— includes the main content of the page that is visible to users. Inside this tag are visual elements such as:<img>
— for inserting images,<p>
— for creating paragraphs,<a>
— for creating hyperlinks,<h1> — <h6>
— for headings and subheadings,<ol>
and<ul>
— for creating ordered and unordered lists,<table>
— for creating tables.