I decided to pay more attention to beginners who want to acquire knowledge in the field of site building. My teacher pushed me to this, who made too many mistakes in the manuals for laboratory work. I would gladly glance at the resource from which the training infa was taken, and leave a couple of lines of my opinion there. But now is not about that. In my first lecture, I will talk about

What is the structure of an HTML document

Tag informs that the structure of the html-document starts, - what ends. Between tags most of the information is stored for the browser and search engines. In tags contains the title of our page. Tag indicates that further information is intended for the user, it naturally indicates that the information for the user is running out.

Now I will explain a little. All tags ( tag - an element of the hypertext markup language) are divided into two types "single" and "closing". Additionally, tags are enclosed in the following characters < and > , they are what distinguish the tag from plain text html... Let's look at some of the simplest "single" tags:


- a tag that is responsible for wrapping to a new line, in the place where this tag is installed. Let's look at the code using this tag.

My first site Hello everybody!
And this is my first site.

You can see the result.


Is a tag that draws a horizontal line. This tag refers to block elements, the line always starts on a new line. Has 5 attributes:

  • align - Determines the alignment of the line. Can be left, center, right.
  • color - Sets the line color.
  • noshade - Draws a line without 3D effects.
  • size - Sets the thickness of the line.
  • width - Sets the width of the line.

Code using tag


:

My first site Hello everybody!


And this is my first site.

A visual example is found.

Another "single" tag is ... This tag is used to store information intended for browsers and search engines. Search engines look to meta tags to get site descriptions, keywords, and other data. An unlimited number of meta tags are allowed, all of them must be between and ... The parameters of any meta tag have the form "name = value", which is determined by keywords content, name or http-equiv... Because meta tags are for machines, they do not make any visual change, so I will only provide the source code:

This line indicates that the page creator believes that the page uses UTF-8 encoding. Everything has become simpler in HTML5, in order to specify the encoding, just the following line is enough:

There are other single tags ( , ,
, , , ,


, , , , , , , , , ), but I'll introduce you to them a little later.

Now let's talk about closing tags. The very name "closing tag" means that the tag requires mandatory closing. This is done in order to clearly limit the part of the text that the tag acts on.

For an illustrative example, take a look at the tag which is used to highlight text, it sets the font to bold. Tags: and are the borders that define the selection area of ​​the text. Here is the code where the last line forgot to close the tag :

My first site Hello everybody! And this is my first site.
Hello everybody! And this is my first site.

As you can see, there is nothing complicated, now you can create several linked pages.

Tags for highlighting text

There are several ways to highlight text on a page. You can do this using styles, or you can use tags. We are (for now) interested in the second option.

- sets the font to bold.

- sets the font to italic.

- adds underline to text.

- designed to accentuate the text. Browsers render such text in italics.

- crosses out the text. This tag has been removed from HTML5, it is recommended to use it instead

- displays text in monospaced text. Excluded from HTML5.

- displays the font as a superscript. The font is displayed above the baseline of the text and reduced in size.

- displays the font as a subscript. The text is positioned below the baseline of the rest of the line characters and the reduced size.

- designed to accentuate the text. Browsers render such text in bold.

- Reduces the font size by one compared to normal text. In HTML, the font size is measured in arbitrary units from 1 to 7, the average text size used by default is 3. Tag decreases the text by one conventional unit. Nested tags are allowed , while the font size will be smaller by 1 with each nested level, but cannot be less than 1.

- increases the font size by one compared to normal text. In HTML, the font size is measured in arbitrary units from 1 to 7, the average text size used by default is 3. Thus, adding a tag increases the text by one conventional unit. Nested tags are allowed , the font size will be larger with each level.

- used to highlight quotes in the text. The contents of the container are automatically displayed in quotes in the browser.

- designed to highlight long quotes within a document. Text designated with this tag is traditionally displayed as an aligned box with left and right padding (approximately 40 pixels) and padding at the top and bottom.


- defines a block of preformatted text.  Such text is usually displayed in a monospaced font and with all spaces between words.  By default, any number of consecutive spaces in the code is shown as one on the web page.  Tag 
Allows you to bypass this feature and display the text as required by the developer.

- defines a text paragraph. Tag

It is a block element, always starts on a new line, paragraphs of text following each other are separated by a padding. The amount of padding can be controlled using styles. If there is no end tag, the end of the paragraph is considered to be the beginning of the next block element.

..
..

- HTML offers six headings at different levels that show the relative importance of the section after the heading. So, the tag

represents the most important first-level heading, and the tag

serves to denote a sixth level heading and is least significant. By default, the first level heading is displayed in the largest bold type, the headings of the next level are smaller in size. Tags:

,…,

refer to block elements, they always start on a new line, and after them other elements are displayed on the next line. In addition, white space is added before and after the heading. The tag has an attribute align, which determines the alignment of the title, can be left- alignment of the title to the left, center- center alignment, right- right alignment, justify- justified alignment (both right and left). This value only works for a header that is more than one line in length.

- is a container for changing font characteristics such as size, color and typeface. Although this tag is still supported by all browsers, it is deprecated and is recommended to be dropped in favor of styles. The tag has 3 attributes: color- sets the color of the text, face- defines the typeface, size- sets the font size in conventional units.

- marks the text as a quote or footnote to another material. This highlighting is useful for changing the style of text through CSS, and is also useful for separating HTML code into structural elements. Browsers usually set text inside a container in italics.

- indicates that the character sequence is an abbreviation. Using the attribute title the decoding of the abbreviation is given, which makes it possible to understand the abbreviation for those people who are not familiar with it. In addition, search engines index the full-text version of the abbreviation, which can be used to improve the ranking of the document.

By default, the text enclosed in the container underlined by a dotted line.

Below is the code where I used all these tags:

My first site

Html and CSS are two of the core technologies for building Web pages. HTML provides the structure of the page, CSS the (visual and aural) layout, for a variety of devices. Along with graphics and scripting, HTML and CSS are the basis of building Web pages and Web Applications. Learn more below about:

What is HTML?

HTML is the language for describing the structure of Web pages. HTML gives authors the means to:

Publish online documents with headings, text, tables, lists, photos, etc.
Retrieve online information via hypertext links, at the click of a button.
Design forms for conducting transactions with remote services, for use in searching for information, making reservations, ordering products, etc.
Include spread-sheets, video clips, sound clips, and other applications directly in their documents.
With HTML, authors describe the structure of pages using markup. The elements of the language label pieces of content such as “Paragraph,” “list,” “table,” and so on.

What is XHTML?

XHTML is a variant of HTML that uses the syntax of XML, the Extensible Markup Language. XHTML has all the same elements (for paragraphs, etc.) as the HTML variant, but the syntax is slightly different. Because XHTML is an XML application, you can use other XML tools with it (such as XSLT, a language for transforming XML content).

What is CSS?

CSS is the language for describing the presentation of Web pages, including colors, layout, and fonts. It allows to adapt the presentation to different types of devices, such as large screens, small screens, or printers. CSS is independent of HTML and can be used with any XML-based markup language language. The separation of HTML from CSS makes it easier to maintain sites, share style sheets across pages, and tailor pages to different environments. This is referred to as the separation of structure (or: content) from presentation.

What is WebFonts?

WebFonts is a technology that enables people to use fonts on demand over the Web without requiring installation in the operating system. W3C has experience in downloadable fonts through HTML, CSS2, and SVG... Until recently, downloadable fonts have not been common on the Web due to the lack of an interoperable font format. The WebFonts effort plans to address that through the creation of an industry-supported, open font format for the Web (called "WOFF").

The lecture has come to an end, I hope the acquired knowledge will be useful to you! In the next lecture, I will tell you about what the tag stores in itself. , we will learn how to perform all sorts of image manipulations, and get acquainted with tables.

When writing this article, the description of some of the tags was taken from here

HTML ( H yper t ext M arkup L anguage) is the code that is used to structure a web page and its content. For example, content could be structured within a set of paragraphs, a list of bulleted points, or using images and data tables. As the title suggests, this article will give you a basic understanding of HTML and its functions.

So what is HTML?

HTML is not a programming language; it is a markup language that defines the structure of your content. HTML consists of a series of elements, which you use to enclose, or wrap, different parts of the content to make it appear a certain way, or act a certain way. The enclosing for paragraph. Note that the end tag "s name is preceded by a slash character>", and that in empty elements the end tag is neither required nor allowed. If attributes are not mentioned, default values ​​are used in each case. "> Tags can make a word or image hyperlink to somewhere else, can italicize words, can make the font bigger or smaller, and so on. For example, take the following line of content:

My cat is very grumpy

If we wanted the line to stand by itself, we could specify that it is a paragraph by enclosing it in paragraph tags:

My cat is very grumpy

Anatomy of an HTML element

Let "s explore this paragraph element a bit further.

The main parts of our element are as follows:

  1. The opening tag: This consists of the name of the element (in this case, p), wrapped in opening and closing angle brackets... This states where the element begins or starts to take effect - in this case where the paragraph begins.
  2. The closing tag: This is the same as the opening tag, except that it includes a forward slash before the element name. This states where the element ends - in this case where the paragraph ends. Failing to add a closing tag is one of the standard beginner errors and can lead to strange results.
  3. The content: This is the content of the element, which in this case, is just text.
  4. The element: The opening tag, the closing tag and the content together comprise the element.

Elements can also have attributes that look like the following:

Attributes contain extra information about the element that you don "t want to appear in the actual content. Here, class is the attribute name and editor-note is the attribute value... The class attribute allows you to give the element an identifier that can be used later to target the element with style information and other things.

An attribute should always have the following:

  1. A space between it and the element name (or the previous attribute, if the element already has one or more attributes).
  2. The attribute name followed by an equal sign.
  3. The attribute value wrapped by opening and closing quotation marks.

Note: Simple attribute values ​​that don "t contain ASCII whitespace (or any of the characters" "'=< >) can remain unquoted, but it is recommended that you quote all attribute values, as it makes the code more consistent and understandable.

Nesting elements

You can put elements inside other elements too - this is called nesting... If we wanted to state that our cat is very grumpy, we could wrap the word "very" in a) indicates that its contents have strong importance, seriousness, or urgency. Browsers typically render the contents in bold type. "> element, which means that the word is to be strongly emphasized:

My cat is very grumpy.

You do however need to make sure that your elements are properly nested. In the example above, we opened the element represents a paragraph. ">

element first, then the) indicates that its contents have strong importance, seriousness, or urgency. Browsers typically render the contents in bold type. "> element; therefore, we have to close the) indicates that its contents have strong importance, seriousness, or urgency. Browsers typically render the contents in bold type. "> element first, then the element represents a paragraph. ">

element. The following is incorrect:

My cat is very grumpy.

The elements have to open and close correctly so that they are clearly inside or outside one another. If they overlap as shown above, then your web browser will try to make the best guess at what you were trying to say, which can lead to unexpected results. So don "t do it!

Empty elements

Some elements have no content and are called empty elements... Take the element embeds an image into the document. "> element that we already have in our HTML page:

This contains two attributes, but there is no closing tag and no inner content. This is because an image element doesn "t wrap content to affect it. Its purpose is to embed an image in the HTML page in the place it appears.

Anatomy of an HTML document

That wraps up the basics of individual HTML elements, but they aren "t handy on their own. Now we" ll look at how individual elements are combined to form an entire HTML page. Let "s revisit the code we put into our index.html example (which we first met in the Dealing with files article):

My test page

Here, we have the following: