If you decide to create a website, then without a languagehypertext markup html you will not go far. Of course, there is also CSS, PHP and other scripting languages, without which a full-fledged website you used to see it will not work. However, it is the main html tags that will allow you to lay the foundation for your site.
Когда вы открываете какой-либо html документ или web page, you see a huge number of different tags. However, if you look closely, most of them are repeated, because they describe the same elements. For example, the main html tags include tags such as the document type , ,
, ,, and others.
To specify the type of the current document is usedthe element. It is necessary for the browser to recognize how to interpret a specific web page. Depending on which version of html you are using, this element will look different. In HTML5, it will take the following value:
Once you have indicated which typeapplies your document, you should use the tag. Like most other tags, it is paired, that is, it has opening and closing tags. The difference between them is that there is a slash "/" before the closing tag. Thus, the most basic html tag for creating a site will look like this:
...
html>
Between the opening and closing tags in this case will be located the rest of the code, which will enclose the entire contents of the web page.
This tag is also the main html tag.It is written after the , and is also paired and contains mostly web page metadata. This data is not displayed in the visible part of the html page (with the exception of the
Metadata
head>
The main tag for the html site, since it was hecontains all the visible elements of the page - all the text, all the pictures and other information. Essentially, like the tag, it is a container for other tags. Example:
Visible webpage content
body>
All of the above tags are basic.html language tags. However, in the language of hypertext markup, there are still a huge number of other elements. For example, paragraph tags and headings. They allow you to structure the text, break it into separate paragraphs and select. So, for paragraphs the
tag is used, it is a pair tag, between which opening and closing elements there is some text. Example:
Paragraph text
p>
In addition to paragraphs, the text can also containheadlines. However, they also change the appearance of the text contained inside, increasing its size and highlighting it in bold. There are 6 types of headings that vary in size. For example, the
No site is complete without images,pictures and photos. Indeed, without this, web pages would be a dry text, uninteresting to study. To insert any image on the site, the tag is used in the hypertext markup language. It is important to note that this tag is not paired, so in the code it will be written as .
Often, in addition to text and various images,The sites use links. They can redirect to a third-party resource or to another page of your site. In order to indicate the presence of a link, the tag is used.
We sorted out the main tags a bit.However, most tags also have attributes. They are written in the opening element and consist of two parts. The first one is the name of the attribute itself, the second is the value of this attribute, which is written after the "=" sign and is enclosed in quotes.
Many tags have attributes.However, for some tags, their presence is optional if you do not want to modify the elements in any way. For other tags, the presence of attributes is mandatory, for example, the tag (for creating hyperlinks) and the tag (for adding images to the page). The thing is that if we do not specify attributes and their values in these main tags, html, we will not see them on the site page.
If you specify in the code the text enclosed in a tag, except for this text on the web page, you will not see anything. The tag itself, in fact, speaks only of the intention to create a hyperlink, and in order to actually create it you will need an attribute. This attribute will be href, and the value of this attribute will be a specific link to the resource. Thus, if we want to create a link to the site fb.ru, it will look like this:
So all the text that is between the tags is a hyperlink, and the value of the href attribute enclosed in double quotes will be the address to which we will go by clicking on the text.
The situation is similar with the tag.If we do not specify the attribute and its value together with it, the images on the web page will not appear. As in the case of the tag, the presence of the tag only means that we are going to insert a photo into our code. However, in order for this image to appear, you must specify the address of this image. For these purposes, you will need to use the src attribute, the value of which will be the address of an image located on a third-party resource or on your computer.
Кроме того, у тега существует еще один attribute. It is not considered mandatory, but is recommended for use. This attribute is the alt alternate text attribute. The value of this attribute will be the text corresponding to the description of the photo or image. This text will be displayed if, for any reason, the image fails to load. In addition, the use of this attribute will help visually impaired people who use screen readers. Thus, the tag together with the two attributes represented will look like this:
alt = "image description" />
There are a huge number of attributes;the list is as huge as the list of main html tags. However, there is an attribute that is inherent in a number of tags at once. This is align. It can be used with the tag, as well as with the
tag. Its essence is that it sets the position of the image or text on the page. The most basic values of this attribute are right and left, which denote right and left justification (respectively). If you apply it to the image, the code will look like this:
alt = "image description"
align = "right" />
However, it is worth noting that recentlysome of these attributes are not used, and cascading style sheets (CSS) are used instead. In order to use styles, a tag is written in html, which is intended for connecting styles and is located in the
tag.