The structure of an html document is the main tags. Correct HTML document structure and page code
Good day, readers and guests of the blog. I’m with you again, your humble assistant in learning the basics of the hypertext markup language html. In this article I want to touch on the topic of structuring website pages and introduce you more closely to the main tags of the language.
The topic of website structure html is one of the most important and is the foundation of website building, after mastering which you can easily create an individual design for your pages and websites. For a detailed study of the topic, the article provides not only theoretical material, but also a specific example of creating a blog. Now it's time to start learning!
Looks scary, easy to program
For those who are particularly restless, I will begin the introduction with an example. Below is a simple program code that I wrote specifically for this article. Don't worry. Each step will be given a detailed explanation.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
Article 1Here is the text of the first article. Article 2Here is the text of the second article. |
Creating a site structure using html
- Basic hypertext markup language tags
- New tags that came with html 5
- Page structuring example
Article 1
Here is the text of the first article.
Article 2
Here is the text of the second article.
This code creates a blog page, which in turn is divided into a header, a menu, a main panel (layout), which contains a content panel (content) and a sidebar (sidebar), as well as a “footer” (footer).
Let's start the debriefing from the first line.
is a language element whose main task is to indicate the type of web document. In this way, the browser determines by what standard the page should be displayed, since today there are several versions of html.
However, it is worth paying attention to a new unit of language called style. As you may have guessed from the name, this tag sets the style and adjusts the arrangement of objects on the page.
Logically, I can assume that the question immediately arose in your head: “What kind of incomprehensible code is located in this part of the program? It doesn’t look like html at all!” And the answer is this: it is not the html that is written into the style tag, but the css code. As previously mentioned, this is a tool for formatting the appearance of websites.
Div refers to markup language block tags. It is used to isolate certain fragments for the purpose of their further modification.
Blocks are managed using cascading style sheets, i.e. css language The example web page has three blocks that are styled using class attributes.
Thus, the code contains:
- layout – block responsible for the main part of the page,
- sidebar – sidebar (usually created for navigation),
- content – the block in which blog posts are located.
In the element with the sidebar class definition, I define an unordered list using the elements
- And
- . In a block with a style class content – heading tags
and paragraph
Now let’s take a closer look at the block
.HTML or still HTML 5? How to recognize?
In a div with the layout style class, in addition to other blocks, there are tags such as header, menu and footer. Unlike the other elements in the example, these are specific to the HTML 5 platform.
Thus, header is an element of hypertext markup language, usually creating the header of site pages or sections in which the title is inserted. It is worth noting that the Internet Explorer browser does not support header up to version 8, but displays its contents.
The main purpose of the menu tag is to display menu items. Similar to the elements for creating numbered and unnumbered lists, inside the menu container, each content item is included in a paired tag
- .
And finally, the footer language unit. In web developer jargon, this is sometimes called the “footer” of a page. This tag is located at the bottom of the page or sections. The footer usually contains information about the authorship of a particular resource, the date of creation of the document, background information or other materials that do not require special attention from the readers of the web resource.
Tools for creating web resources
Many software products have been created to develop Internet pages. Conventionally, they can be divided into simple editor programs and professionally oriented software products.
When creating a website, the first thing you need to imagine is how the web page is formed. This is a kind of “foundation” in website building. Therefore, before delving into more complex website creation technologies, it is recommended to have at least basic knowledge of HTML. In this lesson we will get acquainted with HTML, let's sort it out HTML document structure and use practical examples to consolidate the knowledge gained.
What is HTML?
HTML stands for HyperText Markup Language. This language is responsible for exactly how hypertext will be displayed on site pages. Now let's figure out what hypertext is? It's no secret that a single web page can contain a lot of different types of information, be it text, some tables, graphs, videos, audio, etc. So, all this information can be called in one word - hypertext.
Note that HTML is a markup language, not a programming language. This language does not have any logical functions and it is impossible to perform any mathematical calculations in it. HTML pages have extension .html or .htm and are processed by browsers - IE, Mozilla Firefox, Google Chrome, Yandex Chrome, Opera, etc.
Now let's figure out how the browser understands what and how to display on a web page? It's very simple. The hypertext markup language HTML has built-in commands called tags. It is by them that the browser is oriented.
HTML Document Structure
Any HTML document (web page) must have a certain structure. This will avoid possible problems when opening pages in browsers. As an example, let's look at a page that contains the following HTML code:
HTML Document Structure ...
- .