HTML markup language
HTML markup language
HTML is a markup language for hypertext documents. It is needed to display in the browser a specially formatted document with many nested elements: headings, paragraphs, lists, hyperlinks, media sources, image, video and audio arrangements.
An HTML document can be created in any editor that is in the operating system: Notepad on MS Windows, TextEdit on Mac, Pico on Linux. A browser for working with an HTML document is desirable, but not required. It is needed in order to show the formatted document.
You can view HTML pages without access to the Internet. To do this, you need to create several HTML files in one folder, place hyperlinks in them and navigate through them from one document to another.
What are tags
An HTML document is a text file with an .html or .htm extension. In the browser, it is converted into a web page and consists of a set of tags. They just help to present the text on the screen: thanks to them, the browser understands that it is reading not just text, but structured information, divided into blocks.
The tag looks like a set of characters enclosed in angle brackets. The characters in parentheses indicate the name of the tag, which describes its function.
A tag is a composite element that defines the markup of structural blocks. It opens, and with this begins its action; and closes to indicate the end of the command. Closed and open tags differ only by a slash before the tag name. These tags create a wrapper in which the text is placed.
It is unclosed tags that lead to frequent errors and incorrect page displays. For clarity, let’s imagine that tags are nesting dolls from which you can assemble a set. When putting all the figures into a large nesting doll, it is important not to forget to close all halves (put closing tags), otherwise the toy will not work.
There can be attributes inside the tag – additional information that needs to be hidden from the main text. They are placed only in the opening tag, there must be a space between it and the tag name, and after it there is an equal sign. The attribute value is enclosed in quotation marks. They can be used to extend the capabilities of tags and refer to them for detailed information.
There are tags that do not need to be closed. Example: line break tag <br> – it is single and does not need to be closed. Previously, single tags were written with a closing slash before the closing brace. For example: <br />. In the HTML5 standard, the use of a closing slash in single tags is optional. Examples of single tags: <br>, <hr>, <img>.
In addition to attributes, attachments can be added to the tag, these elements can change the style of the text. For example, you can highlight some word in <strong>bold</strong> font.
Purpose of tags
<!DOCTYPE html> – is intended to indicate the type of document, since the browser can interpret different versions of HTML (for example, EXtensible HyperText Markup Language, extended hypertext markup language). By default, it is always included at the top of the page.
<html> </html> – Tells the browser what kind of HTML document this is. This tag contains the rest of the tags.
<head> </head> – is needed to store other elements that help the browser work with data. Within it are meta tags that are used to store information for browsers and search engines.
<body> </body> is the body of the document, which contains all the elements visible to the user.
<title> </title> is the title of the web page. It is his browser that will load as a title, and when saving the page to favorites, he uses this phrase as a description of the bookmark.
<img> – puts the image in the right place. Usually, the src attribute is added to it, which contains the path to this image. The width and height attributes define the width and height of the image in pixels.
The basic markup of an HTML page is headings, paragraphs, and lists. They structure the information on the page, just like in a Word document.
Is HTML a programming language?
HTML does not process the data, but only displays it. That is, with it you cannot perform addition or multiplication, you can only show the text, which will contain the desired formula with the answer. It is responsible for markup – a limited set of actions that helps the browser to display pages.
However, HTML has syntax, semantics, and vocabulary, which is why it falls into the category of declarative programming languages.