This page has been robot translated, sorry for typos if any. Original content here.

Work with text

Work with text

Since all browsers are not provided for the introduction and editing of information, we will need to use any HTML editor or simply Notepad to learn this topic. If you chose the second option, then first enter the tag set in the following sequence: <html> <head> </ head> <body> </ body> </ html>. This indicates that an HTML document will be created. Inside the <body> </ body> container, the main events will occur on page layout and work with text including. Let's rush there.

To work with text in HTML, a large number of tags are provided that are divided by the formatting method into two groups. The first is the tags intended for formatting the paragraph (a fragment of the text), and to the second, any single character from the text. Let's start in order.

Tags for formatting paragraphs.

The main one is the tag <P> (c English Paragraph - paragraph). Type in the notepad where you want: <P> Browse Window </ P> , then "save as" to a file with the .html extension and open it in the browser. You will see the Browse Window . Repeat the same with <FONT> , <BASEFONT>, <SPAN> , and <DIV> tags ( note they are also in this group), but write them in a column and find the differences between paragraphs. In the future, this is useful when choosing between them.

Now we'll work on the modification of the font . In order to select a font, we apply the FACE attribute to the above tags, set its name ( Arial , Tahoma , etc.) or serif - with serifs; san_serif - without serifs; cursive - italic; monospace - monospace

Example: <SPAN FACE = "Tahoma, Arial, san_serif"> .

Here, the value describes several fonts for good reason. If the end user does not have the font "Tahoma" in the operating system, then "Arial" will appear on the monitor, etc.

Practice on your PC with attributes SIZE (font size) and COLOR (color).

The <U> and <STRIKE> tags emphasize and cross out the text accordingly.

The <PRE> tag is intended for inserting HTML-ready documents into the page, providing a separate paragraph on it. It can be various tables, forms, templates, etc.

Tags for character formation

  • <I> and <EM> - set the characters to italic spelling. Attributes do not have.
  • <B> and <STRONG> - set the characters to bold. Attributes do not have.

About all of the above, we can say that it is of general knowledge for a complete understanding of the structure of the HTML language. In practice, HTML editors with built-in text formatting tools and cascading style sheets are used in practice. But we strongly recommend that you study these tags, because without this knowledge you can not manually modify the page code.

Building lists

Lists on Web pages are used quite often to list something. They fall into three categories. We list their list with visual examples:

  1. Numbered lists (Ordered List). The tag has the designation <OL> and internally enumerates the list items that are enclosed in the <LI> container. Here is an example: <OL> <LI> element1 <LI> element2 ... <LI> element n </ OL> . Note that the <LI> tag is not closed . The <OL> tag has the attribute TYPE with the values: 1- Arabic numerals, A- uppercase Latin letters, a- line Latin letters, I- rom Roman numerals, i -strings Roman numerals.
  • Unordered List. The tag has the designation <UL> and according to the principles of construction in the HTML-code is the same with the previous one with the difference in the values ​​of the attribute TYPE. Here we have the following values: square-square , circle-circle and disk- colored disk.
It consists of a header and content in the form of a list of this heading.
The tag designation is <DL> (Definition List).
Nested tags for the <DL> tag
<DT> - makes up the title.
<DD> -describes a description for the header.
The <DT> and <DD> tags do not need to be closed.
The <DT> and <DD> tags do not have attributes.
Find in the HTML-code this page the order of compiling the lists.
Take an example and practice on your computer.

Page encoding

If you spent enough time at the computer, you had to deal with such a phenomenon when the monitor displayed text in the form of incomprehensible symbols. This is a problem encoding. The trick is that characters in different languages ​​(Russian, English, etc.) have different combinations and number of bits, which are commonly called "text encodings". The problem of encoding is solved by the pupe changes in the encoding. This way of constructing text in machine code takes place on the Internet. That visitors of your site did not see instead of Russian letters - "abracodabra"; and they did not have to "pick" in the browser settings - solve this problem by inserting the desired encoding into the <HEAD> container (see above). In Windows, the Russian language supports the following encodings: Windows-1251 , UTF-8 , ISO-8859-5 , KOI-8R , and the Russian encoding of the page will look like this:

<meta http-equiv = "Content-Type" content = "text / html; charset = windows-1251">

The values ​​of the CONTENT and CHARSET attributes are placed in single quotes
For full compatibility of the Russian language on different operating systems, use Windows-1251 .