Html encoding How web pages are painted

As a way of encoding information for transmitting it via the Internet, html encoding is used. The determining parameter during this process is the number of bits involved, it is with their help that a certain character is transmitted. So one bit encodes a pair of values, two bits are designed to encode four values, three bits - eight. By adding a bit, you can double the number of encoded values. So, 8 bits are capable of encoding 256 sequences (values) in binary code. A notable feature is that each sequence retains the ability to transmit one text character. An alternative to encoding eight bits is encoding for 16 and 32 bits, they already can handle 65536 and, accordingly, 4294967296 text characters.

Html encoding
Opening the Internet Explorer browser included with Windows OS, you can see an extensive list of different encodings in the "View - Encoding" menu item. It should be remembered that the Russian html encoding is represented by six main tables that support the Cyrillic alphabet. The most common among them is Windows-1251, followed by ISO-8859-5, UTF-8, KOI-8R, KOI-8U, there is also a Russian-language encoding for the Mac environment.
Russian html encoding

Html encoding allows you to correctly display information on a web page. Thanks to the existing protocol, there is an exchange of service information between the server and the web browser, which contains comprehensive information about the method used to encode text.

Using the HTTP protocol, the process of sending from a web browser to the message server is carried out , upon receipt of which, the server finds the necessary page and translates it (transcodes) into the required format. If there is no document (web page) on the server, there is a need to select the necessary encoding yourself (manually).

Html encoding allows you to set the parameters of the loaded page. After all, the rating of a web resource depends on the correctness of its perception by browsers of users. For example, even the color scheme used on the page is set using code.

Html color coding
The html color coding takes place by setting the necessary shade in the gradations of the primary colors. To obtain the desired color on the monitor, it is necessary to mix the basic colors in the required proportion - red (red), green (green) and blue (blue). So, writing in RGB code for pure red looks like rgb (255,0,0). The numerical set in brackets for green will be represented by a selection of 0.255.0, for blue - 0.0.255. Classically yellow color is encoded by a combination of 255,255,0, and the code 255,0,255 corresponds to violet. In black, the numerical combination looks like 0,0,0, in white 255,255,255, and gray 192,192,192.

The above color representation is given for clarity, html encoding involves the use of hexadecimal notation (HEX), which begins with a #. When writing in the HEX code, black will be represented as # 000000, white will be #FFFFFF, and gray will be # C0C0C0. The primary color coding for red, green and blue will look like # FF0000, # 00FF00, # 0000FF respectively.

The W3C consortium uses 16 colors valid for HTML and CSS. The names are accepted for them: aquamarine (aqua), blue (blue), black (black), fuchsin (fuchsia), green (green), gray (gray), lime or lime (lime), ultramarine (navy), chestnut (maroon ), olive (olive), red (red), magenta (purple), silver (silver), white (white), gray (teal) and yellow (yellow). For colors that are not included in this list, it is more correct to use the HEX or RGB code.

A few years ago, the concept of β€œsafe colors” was widespread, limiting the range of colors used in creating web pages to 216 web colors. The development of computer technology has removed all restrictions in this matter.

Source: https://habr.com/ru/post/K22110/


All Articles