Welcome to our blog, where you can find everything about HTML tags and their role. HTML (HyperText Markup Language) is a descriptive language used to structure the content of a page (its texts, images, links, etc.).
An HTML document is a text file that contains tags. These tags must be used in some way to describe the structure of the document correctly. The tags tell the browser how to display the report, some tags allow different media such as images, videos or music to be integrated into the text of the page.
The browser does not display the tags as they are. When a user visits a web page, their browser analyzes (or parses in English) the document and the interpreter in order to display the Web page correctly. For example, if the record contains an <img> tag, the browser will load the Associated image and display the image instead of the HTML tag.
Typically, tags work in pairs. The first tag is the opening tag, and the second is the closing tag. A closing tag must have the same name as the corresponding opening tag. Also, a closing tag must contain a slash between the initial chevron and the name of the tag. Thus, if <p> is an opening tag, < / p> will be the corresponding closing tag. An HTML element consists of an opening tag, text content, and a closing tag:
The basic syntax of HTML tags
The rigidity of the conventions for the closing of the beacons is useful to be able to insert different elements into each other.
Good practice: if you omit the closing tags, the browser will have the free swings to determine how to close an item. These rules are well defined but often counterintuitive (so hard to guess). In order to save you time in the future, choose to close the items.
HTML contains about 140 tags that provide the browser with information about the meaning of an element, its interpretation or its display. Among other things, tags can provide meta-data for HTML, highlight sentences, add multimedia files, or manage online forms.
Here are some of the most frequently used tags:
- <h1>, <h2>, <h3>, <h4>, <h5>, <h6> – These tags allow to define titles of different levels: h1 for major titles and h6 for titles of very specific sections.
- <p> – The tag used to create paragraphs. These paragraphs are usually (automatically) separated by line breaks.
- <to> – This tag is used to create links to external resources: another web page, an e-mail, an image, another section of the document, etc. the <A > tags contain the text that will be used for the link, the href attribute of this element is used to define the target URL : <a href=”url_cible”>of the text that will be read by the user</a>.
- <img> This tag allows you to integrate an image into an HTML document. Here is an example usage: <img src=”url/to/my/image.png” alt=”A description”>
- a <div> and <span> – These tags do not have any special meaning; they simply allow sections of a document to be separated. Most of the time, these tags are used for editing and script (which we will discuss later).
- <, ul>, <ol> and <li> – These tags are used to create lists. < ul> allows to define an unordered list and <ol> to define an ordered list. For each of these lists, the <li> tag will define an element of the list.
Feel free to experiment with these tags. In the following sections, we will see how to integrate multimedia files, forms, tables, etc. In all cases, you can do your own tests with any HTML tag. Make sure you choose the right tag for what you want to do: the semantics of HTML elements are very important, especially for search engines that analyze and classify your site.