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 entering and editing information, you and I will need to master this topic any HTML editor or just Notepad. If you selected the second option, pre-type a set of tags into it in the following sequence: <html> <head> </ head> <body> </ body> </ html>. This indicates that an HTML document will be created. Inside the <body> </ body> container there will be major events on page layout and on working with text as well. Rush there.

For working with text in the HTML language, a large number of tags are provided which are divided by the formatting method into two groups. The first is tags designed to format a paragraph (text fragment), and the second is a single character from the text. Let's start in order.

Tags for paragraph formatting.

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

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

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

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

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

The <U> and <STRIKE> tags underline and cross out the text, respectively.

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

Tags for the formation of characters

  • <I> and <em> - set characters to italics. Attributes do not have.
  • <B> and <STRONG> - set the characters to bold. Attributes do not have.

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

Building lists

Lists on Web pages are used quite often to list something. They are divided into three categories. Here is a list of them with visual examples:

  1. Ordered List. The tag has the designation <OL> and places inside itself the enumerators of the list items that are enclosed in the <LI> container. Here is an example: <OL> <LI> element1 <LI> element2 ... <LI> element n </ OL> . Please note that the <LI> tag does not close . The <OL> tag has the TYPE attribute with values: 1 is Arabic numerals, A is an uppercase Latin letter, and is a lowercase Latin letter, I is an uppercase Roman numeral, i is a lowercase Roman numeral.
  • Unordered List. The tag has the designation <UL> and according to the principles of construction in HTML code it is the same as the previous one with a difference in the values ​​of the TYPE attribute . Here are the following values: square-square , circle -circle and disk -filled disk.
List of definitions
Consists of a title and content in a list of this title.
Tag designation - <DL> (Definition List).
Nested tags for the <DL> tag
<DT> - makes a headline.
<DD> -contains a description for the title.
The <DT> and <DD> tags do not need to be closed.
The <DT> and <DD> tags have no attributes.
Find in the HTML-code of this page the order of listing.
Use as an example and practice on your computer.

Page encoding

If you spent enough time at the computer, then you had to deal with the phenomenon when the monitor displayed text in the form of incomprehensible characters. This is a coding problem. The trick is that the characters in different languages ​​(Russian, English, etc.) have different combinations and the number of bits that are commonly called “text encodings”. The coding problem is solved by changing the crease. This method of constructing text in machine code takes place on the Internet. That visitors of your site would not see instead of the Russian letters - "abbrakodabra"; and they didn’t have to “tinker” in the browser settings - solve this problem by inserting the desired encoding into the <HEAD> container (see above). In Windows, the following encodings support Russian: 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">

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