Work with text

Work with text

Since all browsers are not provided for the introduction and editing of information, we will need to use this HTML editor or simply Notepad to learn this topic. If you chose the second option, then pre-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 container <body> </ body> the main events will occur on page layout and work with text including. Let's rush there.

To work with the text in HTML there are a lot of tags 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 to: <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 in the value are described 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 a page, providing a separate paragraph on it. It can be various tables, forms, templates, etc.

Character Generation Tags

  • <I> and <EM> - set the characters to italicized. 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 enumerate 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 places the list enumerators inside the container, which 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 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.
Lists-definitions
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.
Note
The <DT> and <DD> tags do not need to be closed.
The <DT> and <DD> tags have no attributes.
Tasks:
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 have 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 referred to as "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">

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