The paired html tag is called. Tags in HTML. Single and paired tags. How to write paired tags correctly
HTML is plain text file with extension .htm (html). For creating the simplest page at first, when you are just training, you only need a notebook. Open notepad and write some text.
Each HTML element is a tag surrounded by<> brackets. Any file, html page starts with a tag and ends with the tag.
This tag simply tells the browser (this is the program in which you are browsing the web) that this document is an html markup document.
Tag - means the beginning of the html document, and - closing tag means the end of the html document.
There are a few more important tags inside these tags. Immediately following the tag there are tags meaning the page title and page body.
Tag
Now you can create a new one text Document in notepad, copy the text presented above and save it as Page1.html and run it in the browser, you will see the title of the page from
So, the above text will be the basic skeleton of any web page for us.
Paired and unpaired tags!
,
, These are just paired tags - those tags that go as a pair of tag and its closing, closing tag with a /. For paired tags, the value between the start of the tag and the end of the tag is the action of the tag. The action will propagate until a tag with the / character is found.Unmatched tags - they don't have an end tag. Below we will provide examples of such tags.
— Html header pages that include keywords for search engines, various scripts, etc. - Directly the body of the html document.
Unpaired tag.
Note: In most cases now, when building sites, they use ready-made routines, plugins, etc. - for more fast creation sites, but in order to apply and use such routines and templates, a minimum knowledge of these sessions is still required.
Tag (pl. tags, sometimes tag) Is an HTML element used to markup the source text of a web page. Tags are abbreviations or abbreviations of English words enclosed in angle brackets<>e.g. tag
…
shorthand for the English word paragraph, that is, the text enclosed in this tag will be recognized by browsers as a paragraph.Each tag in HTML has a special meaning and is responsible for displaying certain data. The case of letters in tag names does not matter, for example, tag
…
and the tag…
- It is the same. That is, tags can be written in both lowercase and uppercase letters. It used to be generally accepted that all tags should be written in capital letters to distinguish tags from normal text. Now there is no such need, as many editors have syntax highlighting.Classification of tags
There are more than 90 tags in HTML in total. As a rule, one tag affects only part of the document, for example, the first level heading tag
…
... In such cases, paired tags are used: opening and covering... Opening tag (for example,) creates an effect, and the closing ( ) - terminates its effect. As you can see from the example, the closing tag always has this symbol ( / ) - forward slash. Such tags are called paired.
Some tags have a one-time effect where they appear. For example, the horizontal bar tag
or picture display tag ... Such tags have no end tags. Such tags are called non-paired tags.
Types of tags
In addition, tags are divided into several types, which differ in their functions:
- document title tags;
- block elements;
- inline elements;
- universal elements;
- lists;
- tables;
- frames.
This separation is not strict, so some tags are in different groups... For example, tags for creating lists
- and
- empty elements — ,
,
,, - elements with unformatted text —
- apply to both lists and block elements.
Tag structure
When loaded in a browser, the tags themselves are not displayed, but they affect the way their content is displayed. If there is a mistake in the spelling of the tag, it is ignored entirely.
All tags have a specific structure that must be followed when writing. In addition, almost all tags have various attributes that can change the way the content is displayed.
Let's take a look at correct structure tags containing attributes:
As an example, I gave two completely different tags. First single - is responsible for displaying images, attribute - src \u003d "logo.jpg"... Second … paired is responsible for creating links, attribute - href \u003d "site".
Conclusion 1: Attributes can have paired and unpaired tags.
Conclusion 2: Attributes can only have opening tags, closing tags have no attributes.
Picture for clarification:
Figure 1. The structure of the html tag
The task of attentiveness and knowledge of HTML syntax
Let's take a look at an example of a simple web page that we looked at in the tutorial.
HTML tags - the basis of the HTML language. Tags are used to differentiate the beginning and end of elements in the markup.
Every HTML document consists of a tree of HTML elements and text. Each HTML element is identified by a start (opening) and end (closing) tag. The start and end tags contain the tag name.
All HTML elements are of five types: