TOC

This article is currently in the process of being translated into Russian (~39% done).

Introduction to HTML:

The Structure of HTML

Прежде чем начать знакомство с HTML очень важно чтобы вы понимали его структуру. HTML - язык разметки и вы можете использовать его для того чтобы размечать различные части вашего контента - примерно так же, как вы используете текстовыделитель на бумажных документах.

HTML Elements

HTML is constructed of elements and it is these elements you use to do your markup. Below is an example of how you could mark up a regular text-paragraph.

<p>This paragraph is part of my content</p>

Здесь у нас есть предложение («Этот абзац является частью моего содержания»)// ("This paragraph is part of mu content"), которое было помещено между <p> и </p>. <p> и </p> называются тегами. Каждый тег состоит из <, аббревиатуры, и >. В этом случае p является аббревиатурой для абзаца. В сочетании, <p> и </p> теги создают элемент. Каждый HTML-элемент начинается с открывающего тега (в данном случае это <p>), а большинство имеет закрывающий тег (это </p>) Внутри открывающего и закрывающего тега вашего элемента находится фактический контент.

Empty Elements

Большинство HTML элементов выглядят так <p></p>, но существует также элементы которые называются пустыми. Перевод строки как раз один из таких, приведём пример:

<br />

As you can see, there is no closing tag and the element do not contain any content, therefore it is called an empty element. Because this is an empty element it is closed at the end of the tag – that’s the /. You don’t have to use the "/" at the end of an empty element, but it is considered good practice, so you might as well get used to it. (As I said before, the tag consists of an abbreviation and in this case br stands for break).

Tip!

When the browsers read your HTML5 document they don’t care whether or not you write your tags in uppercase or lower case. But other developers do! Even though you could write the same linebreak-tag in a lot of different ways, such as these:

<BR />
<bR />
<Br />
<br />

Рекомендуется писать все ваши теги строчными буквами, это облегчает чтение, и считается хорошим умением писать ваши теги таким образом.

Чему вы научились

  • An HTML element starts with a opening tag
  • An HTML element ends with a closing tag
  • A HTML tag starts with a < and ends with a >
  • The letters between the < and > are abbreviations
  • The element content is everything between the start tag and the end tag
  • Some HTML elements are empty
  • Empty elements are closed in the start tag
  • Make it a habbit to type all your tags in lowercase - it is considered good practice
This article has been fully translated into the following languages: Is your preferred language not on the list? Click here to help us translate this article into your language!

adplus-dvertising