CSS properties text-decoration, vertical-align, text-align, text-indent for decorating text in Html. How to raise a block up in css - trivial tasks


I think many of you who have had to deal with layout have encountered the need to align elements vertically and know the difficulties that arise when aligning an element to the center.

Yes, there is a special multi-value vertical-align property in CSS for vertical alignment. However, in practice it doesn't work at all as expected. Let's try to figure this out.


Let's compare the following approaches. Align using:

  • tables,
  • indentation,
  • line-height
  • stretching,
  • negative margin,
  • transform
  • pseudo element
  • flexbox.
To illustrate, consider the following example.

There are two div elements, with one of them nested within the other. Let's give them the corresponding classes - outer and inner.


The challenge is to align the inner element with the center of the outer element.

First, let's consider the case when the dimensions of the external and internal blocks known. Let's add the rule display: inline-block to the inner element, and text-align: center and vertical-align: middle to the outer element.

Remember that alignment only applies to elements that have an inline or inline-block display mode.

Let's set the sizes of the blocks, as well as background colors so that we can see their borders.

Outer ( width: 200px; height: 200px; text-align: center; vertical-align: middle; background-color: #ffc; ) .inner ( display: inline-block; width: 100px; height: 100px; background-color : #fcc; )
After applying the styles, we will see that the inner block is aligned horizontally, but not vertically:
http://jsfiddle.net/c1bgfffq/

Why did it happen? The thing is that the vertical-align property affects the alignment the element itself, not its contents(except when it is applied to table cells). Therefore the application of this property To external element didn't give anything. Moreover, applying this property to an inner element will also do nothing, since inline-blocks are aligned vertically relative to adjacent blocks, and in our case we have one inline block.

There are several techniques to solve this problem. Below we will take a closer look at each of them.

Alignment using a table

The first solution that comes to mind is to replace the outer block with a table of one cell. In this case, the alignment will be applied to the contents of the cell, that is, to the inner block.


http://jsfiddle.net/c1bgfffq/1/

The obvious disadvantage of this solution is that, from a semantic point of view, it is incorrect to use tables for alignment. The second disadvantage is that creating a table requires adding another element around the outer block.

The first minus can be partially removed by replacing the table and td tags with div and setting the table display mode in CSS.


.outer-wrapper ( display: table; ) .outer ( display: table-cell; )
However, the outer block will still remain a table with all the ensuing consequences.

Alignment using indents

If the heights of the inner and outer blocks are known, then the alignment can be set using the vertical indents of the inner block using the formula: (H outer – H inner) / 2.

Outer ( height: 200px; ) .inner ( height: 100px; margin: 50px 0; )
http://jsfiddle.net/c1bgfffq/6/

The disadvantage of the solution is that it is applicable only in limited number cases when the heights of both blocks are known.

Alignment using line-height

If you know that the inner block should occupy no more than one line of text, then you can use the line-height property and set it equal to the height of the outer block. Since the content of the inner block should not wrap to the second line, it is recommended to also add the white-space: nowrap and overflow: hidden rules.

Outer ( height: 200px; line-height: 200px; ) .inner ( white-space: nowrap; overflow: hidden; )
http://jsfiddle.net/c1bgfffq/12/

This technique can also be used to align multiline text if you redefine the line-height value for the inner block, and also add the display: inline-block and vertical-align: middle rules.

Outer ( height: 200px; line-height: 200px; ) .inner ( line-height: normal; display: inline-block; vertical-align: middle; )
http://jsfiddle.net/c1bgfffq/15/

Minus this method is that the height of the external block must be known.

Alignment using "stretch"

This method can be used when the height of the external block is unknown, but the height of the internal block is known.

To do this you need:

  1. set relative positioning to the external block, and absolute positioning to the internal block;
  2. add the rules top: 0 and bottom: 0 to the inner block, as a result of which it will stretch to the entire height of the outer block;
  3. set the vertical padding of the inner block to auto.
.outer ( position: relative; ) .inner ( height: 100px; position: absolute; top: 0; bottom: 0; margin: auto 0; )
http://jsfiddle.net/c1bgfffq/4/

The idea behind this technique is that setting a height for a stretched and absolutely positioned block causes the browser to calculate the vertical padding in an equal ratio if it is set to auto .

Alignment with negative margin-top

This method has become widely known and is used very often. Like the previous one, it is used when the height of the outer block is unknown, but the height of the inner one is known.

You need to set the external block to relative positioning, and the internal block to absolute positioning. Then you need to move the inner block down by half the height of the outer block top: 50% and raise it up by half its own height margin-top: -H inner / 2.

Outer ( position: relative; ) .inner ( height: 100px; position: absolute; top: 50%; margin-top: -50px; )
http://jsfiddle.net/c1bgfffq/13/

The disadvantage of this method is that the height of the indoor unit must be known.

Alignment with transform

This method is similar to the previous one, but it can be used when the height of the indoor unit is unknown. In this case, instead of setting a negative pixel padding, you can use the transform property and move the inner block up using the translateY function and a value of -50% .

Outer ( position: relative; ) .inner ( position: absolute; top: 50%; transform: translateY(-50%); )
http://jsfiddle.net/c1bgfffq/9/

Why was it impossible to set the value as a percentage in the previous method? Since percentage values margin properties are calculated relative to the parent element, a value of 50% would be equal to half the height of the outer box, and we needed to raise the inner box to half its own height. The transform property is perfect for this.

The disadvantage of this method is that it cannot be used if the indoor unit has absolute positioning.

Alignment with Flexbox

Most modern way vertical alignment is to use Flexible Box Layout (popularly known as Flexbox). This module allows you to flexibly control the positioning of elements on the page, arranging them almost anywhere. Center alignment for Flexbox is a very simple task.

The outer block needs to be set to display: flex and the inner block to margin: auto . And it's all! Beautiful, is not it?

Outer ( display: flex; width: 200px; height: 200px; ) .inner ( width: 100px; margin: auto; )
http://jsfiddle.net/c1bgfffq/14/

The disadvantage of this method is that Flexbox is supported only by modern browsers.

Which method should I choose?

You need to start from the problem statement:
  • To vertically align text, it is better to use vertical indents or the line-height property.
  • For absolutely positioned elements with a known height (such as icons) it is ideal a suitable method with a negative margin-top property.
  • For more complex cases, when the height of the block is unknown, you need to use a pseudo element or the transform property.
  • Well, if you are so lucky that you do not need to support older versions of the IE browser, then, of course, it is better to use Flexbox.

Tags: Add tags

Tasks: CSS selectors

Berries: raspberries

For confident layout, you ideally need to know CSS selectors: css class selectors, css attribute selectors, adjacent css selectors, contextual css selectors, child selectors + in css, priority of selectors (finding priority, selector specificity) , selector grouping, first element selector, id selector.

Tasks: CSS selectors

  1. Use attribute selectors to color all hyperlinks that point to leading links social media
  2. An alternative layout task to the previous one: Layout a fragment of an HTML page containing text with hyperlinks, some of which lead to social networks. For each link to a social network, draw an icon.
  3. Use pseudo-class selectors to color an unnumbered list with a zebra stripe
  4. Use pseudo class selector to color all empty HTML divs on the page
  5. Use a pseudo class, to color an HTML element on a page whose id attribute matches the hash of the page address.
  6. * Realize the gallery effect, without using JavaScript. Note: useful for work pseudoclass from the previous task and the ability to work with positioning.
  7. **Create lightbox effect without using JavaScript. Note: The task is not easy. Better skip it and come back to it later after learning/repeating positioning and animation
  8. Paint with context selectors All child elements other elements. Note: Be aware of the differences in how child element selectors and descendant element selectors work
  9. Create small images next to all the links on the page. Use for this sprite image.
  10. In relation to CSS styles to those HTML text elements that contain the word "htmllab". Note: first you need to create markup and place this word in an arbitrary element.
  11. Using pseudo-class, implement a mouseover response on HTML elements.
  12. Write page design styles before printing
  13. With help pseudo-class:hover create a shadow for the hyperlink

All HTML assignments

Task No. 1

Form the poem as shown in the picture:

Evgeniy Yevtushenko

There used to be a dog sleeping at my feet,

the fire is starting to hum,

and the woman from the twilight

looks with unsteady eyes.

Then he will lie down under the fir tree

on my red jacket

and the thoughtful one will say to me:

“Come on, sing!..” -

HTML+CSS problem book from Dmitry Trepachev

Task No. 3

Correct the errors in the following code:

Glossary <title> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <body> <h1>Glossary of Terms</h1> <span> <h2><p>Algorithmic Oriented Language.</h2></p> </span> <span> <h2><p>Creates new project</p></h2> </span> </body> </html></p> <p>Task No. 4</p> <p><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-1"> <body> <h11 align="justify">Galion</h1> <p align="justify"><strong>Galion</b>- a large three-masted ship of particularly strong construction, equipped with heavy artillery.</br> These ships served to transport goods and precious metals from the Spanish and Portuguese colonies to Europe.</p> <hr> <blockquote>The flagship was powerful <i>galleon</i>, armed with forty-eight large cannons and eight small ones.</blockquote> </hr></p> </body> </html></p> <p>Task No. 5</p> <p><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1251"> <head> <body> <h2>Public opinion poll showed</h2> <p>Diego Velazquez painted his canvases in the style of imperialism, cubism and impressionism;</p> Confucianism originated in: Italy, Korea and France;</p> <p>gods of trade and theft in <a href="https://gtavrl.ru/en/kartiny-fentezi-amazonki-voinstvennoe-plemya-zhenshchin/">Ancient Greece</a> were: Mars, Mercury and Dionysus;</p> <li>the gods of the underworld in Egypt were: Hades, Anubis and Assyris;</p> <p>the capital of the Golden Horde is Mongolia;</p> <p>the main opponents of Alexander the Great: the Tatar-Mongols, Daedalus and Caesar;</p> <p>In ancient Greece, the gods ruled the seas: Pluto, Neptune and Triton.</p> </ul> </body> </html></p> <p>Task No. 6</p> <p>Make a page with the Japanese flag as shown in the picture. 1. Size 300x200 pixels, circle diameter 120 pixels. It is prohibited to use any pictures; everything must be done with <a href="https://gtavrl.ru/en/sdelat-animaciyu-css-plavnaya-animaciya-peremeshcheniya-s-pomoshchyu-css-plavnoe/">using CSS</a>. The page should display correctly in all modern browsers.</p> <p><img src='https://i0.wp.com/steptosleep.ru/wp-content/uploads/2018/06/44647.gif' height="204" width="304" loading=lazy loading=lazy></p> <p>*For a circle, use the background property: radial-gradient(circle, #bc002d 58px, #fff 60px);</p> <p>Task No. 7</p> <p>Using styles, create text in a frame, as shown in Fig. 1.</p> <p><img src='https://i0.wp.com/steptosleep.ru/wp-content/uploads/2018/06/2050.jpg' height="191" width="336" loading=lazy loading=lazy></p> <p>Task No. 8</p> <p>Using tags <ol>And <li>build the lists shown in Fig. 1. In this case, you must have valid XHTML and CSS. Lists should be displayed correctly in browsers IE8, Firefox 6, Safari 5, Opera 11, Chrome 8 and their older versions.</p> <p>Make 2 options: 1 – with <a href="https://gtavrl.ru/en/kak-sozdat-veb-stranicu-s-pomoshchyu-bloknota-vvedenie-v-html-opisanie-html-tegov-iz/">using html</a>, 2 – using CSS.</p> <p><img src='https://i1.wp.com/steptosleep.ru/wp-content/uploads/2018/06/68242.gif' height="275" width="236" loading=lazy loading=lazy></p> <p>Task No. 9</p> <p>Write the XHTML code to get the result shown in Fig. 1.</p> <p><img src='https://i2.wp.com/steptosleep.ru/wp-content/uploads/2018/06/90304.jpg' width="100%" loading=lazy loading=lazy></p> <p>Task No. 10</p> <p>Change the style for the table so that it looks like shown in Fig. 1. You cannot make changes to the table code, all design <b>should only be done through styles.</b></p> <p><img src='https://i1.wp.com/steptosleep.ru/wp-content/uploads/2018/06/63866.jpg' height="125" width="276" loading=lazy loading=lazy></p> <p>Task No. 11</p> <p>Make the text as shown in Fig. 1. Set the font to Impact.</p> <p><img src='https://i0.wp.com/steptosleep.ru/wp-content/uploads/2018/06/75459.jpg' width="100%" loading=lazy loading=lazy></p> <p>Task No. 12</p> <p>Create the registration form shown in Fig. 1. The width of the form and its fields is fixed.</p> <p><img src='https://i1.wp.com/steptosleep.ru/wp-content/uploads/2018/06/8378.jpg' height="239" width="346" loading=lazy loading=lazy></p> <h2>CSS Reference</h2> <h2><span>Element position and dimensions</span></h2> <h3>position</h3> <ul><li><i>position</i>— specifies the way the element is positioned; it can take one of the following values: <ul><li><i>fixed</i>— coordinates relative to the browser window;</li> <li><i>relative</i>— coordinates relative to the parent element;</li> <li><i>absolute</i>— coordinates relative to the first parent element with a positioning other than static;</li> <li><i>static</i>— positioning in the usual way, default value.</li> </ul></li> <li><i>left</i>— x coordinate of the upper left corner of the element;</li> <li><i>top</i>— y coordinate of the upper left corner of the element;</li> <li><i>right</i>— x coordinate of the lower right corner of the element;</li> <li><i>bottom</i>— y coordinate of the lower right corner of the element;</li> <li><i>z-index</i>— z coordinate of the element. This allows you to overlay elements on top of each other, creating <i>layers</i>. (overlay example).</li> </ul><h3><span>position via alignment</span></h3> <ul><li><i>text-align</i>— horizontal content alignment. The following values ​​are possible: <ul><li><i>justify</i>— in width;</li> <li><i>left</i>- left;</li> <li><i>right</i>- to the right;</li> <li><i>center</i>— horizontally centered;</li> </ul></li> <li><i>vertical-align</i> — <a href="https://gtavrl.ru/en/html-centrirovanie-po-gorizontali-gorizontalnoe-i-vertikalnoe/">vertical alignment</a> content. The numerical value indicates how much to raise/lower the element relative to <a href="https://gtavrl.ru/en/far-manager-pereiti-na-drugoi-disk-bystryi-poisk-v-panelyah/">current position</a>. String values ​​are also available: <ul><li><i>top</i>- up;</li> <li><i>bottom</i>- down;</li> <li><i>middle</i>- in the middle.</li> </ul></li> </ul><p>In Mozilla and Opera, you can align an object to the center as follows:</p> <p>If the width is known, then you can align it to the center approximately as follows</p> <h3>dimensions</h3> <ul><li><i>width</i>— width of the element;</li> <li><i>height</i>— element height;</li> <li><i>min-width, max-width</i>— minimum and maximum element width;</li> <li><i>min-height, max-height</i>— minimum and maximum height of the element.</li> </ul><h3><span>when the content is larger than the element</span></h3> <ul><li><i>overflow</i>— defines the behavior, the content overlaps the element’s box. The following values ​​are possible: <ul><li><i>auto</i>;</li> <li><i>hidden</i>- hide;</li> <li><i>scroll</i>— scroll;</li> <li><i>visible</i>— display;</li> <li><i>inherit</i>- inherit value.</li> </ul></li> <li><i>clip</i>- allows you to specify the visible rectangle of a child element when its dimensions are larger than the parent element when positioned absolutely. <h2><span>Collection of exercises and tasks in HTML</span></h2> <p>Typically used with images. Style does not work if defined. A rectangle is specified as rect (top, right, bottom, left).</p></li> </ul><h3>Examples</h3> <h2><span>Change dimensions</span></h2> <p>It was easy enough, but in order to conquer three-dimensional space, I had to change my point of view. Instead of rotating the square, I rotated the line and projected onto the line.</p> <p>Wire Frame Perspective:</p> <p>(Interactive demo: triviumCDF2.cdf)</p> <p>I found the change in perspective illuminating, which made me think that the projection length is the sum of the lengths of the projections of the two sides of the area visible on one side.</p> <p>The projection length of a segment of length u ℓ from normal n1 onto a line from normal n2 is equal to ℓ Dot.</p> <p>The projection of each side exists only if the point is positive (i.e. the side is visible); otherwise it is hidden behind the other sides. The length of the shadow is thus the sum of the contributions from the east, west, top and bottom sides of the square:</p> <p>Thus, the projection length is the sum of the absolute coordinate values ​​of the components of the normal vector nvec. I implemented this way of calculating the shadow length depending on:</p> <p>And, of course, this is consistent with the previously presented way of calculating the projection length:</p> <p>Naturally, we expect to see the same thing:</p> <h2>Cube case</h2> <p>Guided by the accumulated knowledge, I turned to a rectangular parallelepiped (cuboid), whose center of mass is located at the origin.</p> <p>The parallelepiped casts its shadow on the plane, the orientation is parameterized perpendicular (i.e. normal) to the nvec vector.</p> <p>I started by constructing a projection of each face of the parallelepiped and combining the resulting drawing. First I defined for this <a href="https://gtavrl.ru/en/tipovaya-organizaciya-sovremennoi-subd-vspomogatelnye/">auxiliary function</a> to project vector xvec onto a plane with normal nvec:</p> <p>Convert front side coordinates to (i,j) with origin at z0:</p> <p>I then defined a function to project each side onto a plane with a normal nvec vector and a corresponding 3D polygon:</p> <p>The area of ​​the polygon is projected onto a plane with normal nvec, and the sum of the areas of two triangles and a quadrilateral divided diagonally is calculated:</p> <p>From now on, I was ready to visualize the projection of a rectangular parallelepiped with unit edge length, whose center of mass is located at the origin, and the sides will be aligned with the coordinate axis. I parameterized the unit vector normal to the projection plane using spherical coordinates θ and φ: (sin(θ) sin(φ), sin(θ), cos(φ), cos(θ)).</p> <p>(Interactive demo: triviumCDF3.cdf)</p> <p>Since at any given time, only three faces of the parallelepiped are visible, I sum up all six faces and divide the result by two.</p> <h2>HTML assignments</h2> <p>For a certain orientation nvec == (- 1,2,3) √14 sides, so the projection area is calculated as follows:</p> <p>Using the knowledge discovered while studying the two-dimensional case, I checked what if the projection area is again equal to the sum of the absolute values ​​of the product (English dot products) of the normal vector nvec with the axis vectors:</p> <p>This makes sense, just as I thought. Each term corresponds to one region out of no more than three <a href="https://gtavrl.ru/en/iz-chego-sdelan-korpus-iphone-7-carapiny-oni-nebolshie-no-horosho-vidny-na-granyah/">visible edges</a>. Consider a section of area S on a plane with normal n1. The area of ​​projection onto another plane with normal n2 is equal to S Abs].</p> <p>A spherical portion of the shadow region cast by a parallelepiped onto a plane with a normal (sin(θ), sin(φ), sin(θ), cos(φ), cos(θ)) as a function of the Euler angles θ and φ.</p> <p>The minimum of the area function corresponds to the area of ​​one side, which is 1, and the maximum is √3, which corresponds to the projection onto a plane whose normal vector coincides with the diagonal of the parallelepiped:</p> <p>I'm almost ready to find the expected size of the area.</p> <p>For a normal unit vector (Nx, Ny, Nz), the expected projection area is:</p> <p>The surface area of ​​the infinitesimal size (θ, θ +dθ) × (φ, φ +dφ) of the unit sphere is well known, sin(θ)dθ dφ. By dividing a negligible area by the total surface area of ​​the unit sphere, I obtain a negligible probability measure corresponding to a uniform distribution on the unit sphere: dS (θ, φ) == 1 / (4 π) sin(θ)dθ dφ.</p> <p>And finally, the projection area is:</p> <p>Of course I could simplify the calculations using the symmetry argument:</p> <p>This is good <a href="https://gtavrl.ru/en/imya-sozdatelya-vk-vkontakte-istoriya-uspeh-izvestnye-i-maloizvestnye/">known fact</a>, (see related question on math.stackexchange.com) that each individual component of a random vector uniformly distributed on the unit sphere follows a uniform distribution on the interval (-1,1). With this understanding, an answer can be worked out in one's head, explaining why this problem was recognized by Arnold in the Trivium:</p> <h2><span>Increasing the dimension of space</span></h2> <p>Understanding this process allowed me to easily construct an answer for the case of a D-dimensional hypercube projected onto a randomly oriented hyperplane:</p> <p>I just needed to know the component distribution of a D-dimensional random unit vector.</p> <p>The calculations are simple, and are based on hyperspherical coordinates (for example, see Wikipedia: n-sphere). The infinitesimal hyperspherical region is also factors like (Sin [θ1] d^-2 dθ1) (Sin [θ2] d^-2 dθ2) ⋯ (Sin [θd-2] d^-2 dθd-2) d^-2 dθd -1. With Nd == cos(θ1), I had to find the normalization constant for the quasi-density Sin[θ1]d^-2:</p> <p>Therefore the expected projection area of ​​a d-hypercube is:</p> <p>Alternatively, I could use the closed form result for the probability density function (PDF) distribution from here:</p> <p>I came to this conclusion by reproducing the results obtained earlier and tables of results for higher dimensions:</p> <p>The average area of ​​the shadow grows infinitely along with the dimension of space, as the number of faces that contribute to its area also increases:</p> <p>In high-dimensional space, area scales as the square root of dimension d:</p> <p>This conclusion was obtained as a result of studying the "trivial" Arnold problem using Mathematica. Using Mathematica resulted in many “Aha!”s. Allowed me to easily answer various "what if..." questions. I hope I have conveyed the research process using Mathematica to inspire you to begin exploring your own solutions.</p> <p>TrivialProbabilityProblemBlog.zip</p> <p>This article is a translation of an entry from the wolfram blog. Author of the original article: Oleksandr Pavlyk (Kernel Developer, R&D at Wolfram Research).</p> <p>Two main tools are often used for page layout - <i>positioning</i> And <i>free movement (floating)</i>. CSS positioning lets you specify where an element's box appears, and free float moves elements to the left or right edge of the container box, allowing the rest of the content to "flow" around it.</p> <h2>Positioning and free movement of elements</h2> <i> </i><h3>1. Types of positioning</h3> <p>The position property allows you to precisely specify the new location of the block relative to where it would be in the normal flow of the document. By default, all elements are arranged sequentially one after another in the order in which they are defined in the structure of the HTML document. The property is not inherited.</p> <table class="t1"><tr><th colspan="2">position</th> </tr><tr><td>Meaning:</td> <td> </td> </tr><tr><td>static</td> <td>The default value means no positioning. Elements are displayed sequentially one after another in the order in which they are defined in the HTML document. Used to clear any other positioning value.</td> </tr><tr><td>relative</td> <td>A relatively positioned element is moved from its normal location to <a href="https://gtavrl.ru/en/pristavka-cifrovogo-tv-dvb-t2-instrukciya-chto-dlya-etogo-nuzhno-takzhe-byvaet/">different directions</a> relative to the boundaries of the parent container, and the space it occupied does not disappear. However, such an element may overlap other content on the page. <p>If for a relatively positioned element you set the properties top and bottom or left and right at the same time, then in the first case only top will work, in the second - left.</p> <p>Relative positioning allows you to set a z-index for an element, as well as absolutely position child elements within a block.</p> </td> </tr><tr><td>absolute</td> <td>An absolutely positioned element is completely removed from the document flow and positioned relative to the boundaries of its container block (another element or browser window). The container block for an absolutely positioned element is the closest ancestor element whose position property value is not static . <p>The location of the element's edges is determined using the offset properties. The space that such an element occupied collapses as if the element did not exist on the page. An absolutely positioned element can overlap or be superimposed by other elements (due to the z-index property). Any absolutely positioned element generates a block, that is, it takes on the value display: block; .</p> </td> </tr><tr><td>fixed</td> <td>Fixes an element at a specified location on the page. The container block of a fixed element is the viewport, that is, the element is always fixed relative to the browser window and does not change its position while scrolling the page. The element itself is completely removed from the main document flow and created in a new document flow.</td> </tr><tr><td>initial</td> <td>Sets the property value to the default value.</td> </tr><tr><td>inherit</td> <td>Inherits the property value from the parent element.</td> </tr></table><br><img src='https://i1.wp.com/html5book.ru/wp-content/uploads/2014/11/static-relative-absolute.png' width="100%" loading=lazy loading=lazy>Rice. 1. Difference between static, relative and absolute positioning <h3>2. Offset properties</h3> <p>Properties describe the offset relative to the nearest side of the container block. Set for elements for which the position property value is not static . They can take both positive and negative values. Not inherited.</p> <p>For the top property, positive values ​​move the top edge of the positioned element below, and negative values ​​move the top edge of its container block. For the left property, positive values ​​move the edge of the positioned element to the right, and negative values ​​move the edge of the positioned element to the left. That is, positive values ​​move the element inside the container block, and negative values ​​move it outside it.</p> <h3>3. Positioning within an element</h3> <p>For the container block of an absolutely positioned element, the position: relative property is set without offsets. This allows elements to be positioned within a container element.</p><p> <div class="wrap"> <div class="white"> </div> </div>.wrap ( padding: 10px; height: 150px; position: relative; background: #e7e6d4; text-align: right; border: 3px dashed #645a4e; ) .white ( position: absolute; width: 200px; top: 10px; left : 10px; padding: 10px; background: #ffffff; border: 3px dashed #312a22; ) <br><img src='https://i1.wp.com/html5book.ru/wp-content/uploads/2014/11/relative-absolute.png' align="left" width="100%" loading=lazy loading=lazy>Rice. 2. Absolute relative positioning</p><h3>4. Positioning problems</h3> <p>1. If the width or height of an absolutely positioned element is set to auto , then its value will be determined by the width or height of the element's content. If the width or height is declared explicitly, then this is the value that will be assigned. <br>2. If inside a block with position: absolute there are elements for which the float is set, then the height of this element will be equal to the height of the tallest of these elements. <br>3. For an element with position: absolute or position: fixed, you cannot simultaneously set the float property, but for an element with position: relative, you can. <br>4. If the ancestor of the positioned element is a block element, then the block container is formed by the content area delimited by the border. If the ancestor is an inline element, the container block is formed by the outer boundary of its contents. If there is no ancestor, the container block is the body element.</p> <h3>5. Free movement of elements</h3> <p>In the normal order, block elements are rendered starting from the top edge of the browser window and working towards the bottom edge. The float property allows you to move any element, aligning it to the left or right edge of the web page or the container element that contains it. In this case, other block elements will ignore it, and inline elements will move to the right or left, freeing up space for it and flowing around it.</p> <img src='https://i0.wp.com/html5book.ru/wp-content/uploads/2014/11/relative-absolute.png' align="left" height="165" width="680" loading=lazy loading=lazy>Rice. 3. Free movement of elements <p>A floating block takes on the dimensions of its contents, taking into account padding and borders. The top and bottom margins of floating elements do not collapse. The float property applies to both block elements and inline elements.</p> <p>The left or right outer edge of a moved element, unlike positioned elements, cannot be located to the left (or right) of the inner edge of its container block, i.e. go beyond its boundaries. Moreover, if internal padding is specified for the container block, then the floating block will be spaced from the edge of the container block at the specified distance.</p> <p>The property automatically changes the calculated (browser-displayed) value of the display property to display: block for the following values: inline , inline-block , table-row , table-row-group , table-column , table-column-group , table-cell . table-caption, table-header-group, table-footer-group. The value of inline-table changes to table .</p> <p>The property has no effect on elements with display: flex and display: inline-flex .</p> <p>When using the float property on block elements, be sure to specify a width. This will create space for other content in the browser. But if the combined width of all columns is greater than the available space, then the last element will go down.</p> <p>At the same time, the vertical margins of floated elements do not collapse with the margins of neighboring elements, unlike ordinary block elements.</p> <h3>6. Cancel flow around elements</h3> <h4>6.1. clear property</h4> <p>The clear property determines how the element that follows the floating element will be positioned. The property cancels the wrap around one or both sides of an element that is set <a href="https://gtavrl.ru/en/adaptivnaya-verstka-tekst-v-dva-stolbca-drugie-sposoby-razbivki/">float property</a>. To prevent background or borders from being displayed under floating elements, use the (overflow: hidden;) rule.</p> <h4>6.2. Cleaning a stream with styles using the clearfix class and the :after pseudo-class</h4> <p>Suppose you have a block container for which the width and height are not specified. A floating block with specified dimensions is placed inside it.</p><p> <div class="container"> <div class="floatbox"> </div> </div>.container ( padding: 20px; background: #e7e6d4; border: 3px dashed #645a4e; ) .floatbox ( float: left; width: 300px; height: 150px; margin-right: 20px; padding: 0 20px; background: #ffffff ; border: 3px dashed #666666; ) <img src='https://i0.wp.com/html5book.ru/wp-content/uploads/2014/11/float1.png' align="left" height="185" width="682" loading=lazy loading=lazy>Rice. 4. “Collapse effect” of the container block</p><p><b>Solution to the problem:</b><br>We create the .clearfix class and, in combination with the :after pseudo-class, apply it to the container block.</p><p> <div class="container clearfix"> <div class="floatbox"> </div> </div>.container ( padding: 20px; background: #e7e6d4; border: 3px dashed #645a4e; ) .floatbox ( float: left; width: 300px; height: 150px; margin-right: 20px; padding: 0 20px; background: #ffffff ; border: 3px dashed #666666; ) .clearfix:after ( content: ""; display: block; height: 0; clear: both; visibility: hidden; )</p><p><b>Second option for clearing the stream:</b></p><p>Clearfix:after ( content: ""; display: table; clear: both; ) <br><img src='https://i2.wp.com/html5book.ru/wp-content/uploads/2014/11/float2.png' align="left" width="100%" loading=lazy loading=lazy>Rice. 5. Applying the “cleaning” method to a container block containing a floating element</p><h4>6.3. An easy way to clean a stream</h4> <p>There is another trick to clean up the flow for an element containing floating elements, such as a horizontal bulleted list:</p><p>Ul ( margin: 0; list-style: none; padding: 20px; background: #e7e6d4; overflow: auto; ) li ( float: left; width: calc(100% / 3 - 20px); height: 50px; margin- right: 20px; background: #ffffff; border: 3px dashed #666666; ) li:last-child (margin-right: 0;) Fig. 6. Cleaning up the horizontal list flow</p> <p>Centering elements vertically using CSS is a task that presents some difficulty for developers. However, there are several methods for solving it, which are quite simple. This lesson presents 6 options for vertically centering content.</p> <p>Let's start with a general description of the problem.</p> <h2>Vertical Centering Problem</h2> <p>Horizontal centering is very simple and easy. When the centered element is inline, we use the alignment property relative to the parent element. When the element is block-level, we set its width and automatic setting of left and right margins.</p> <p>Most people, when using the text-align: property, refer to the vertical-align property for vertical centering. Everything looks quite logical. If you have used table templates, you have probably actively used <a href="https://gtavrl.ru/en/atributy-align-i-valign/">valign attribute</a>, which reinforces the belief that vertical-align is the right way to solve the problem.</p> <p>But the valign attribute only works on table cells. And the vertical-align property is very similar to it. It also affects table cells and some inline elements.</p> <p>The value of the vertical-align property is relative to the parent inline element.</p> <ul><li>In a line of text, alignment is relative to the line height.</li> <li>The table cell uses alignment relative to a value calculated by a special algorithm (usually the row height).</li> </ul><p>But unfortunately, the vertical-align property does not work on block-level elements (for example, paragraphs inside a div element). This situation may lead one to think that there is no solution to the problem of vertical alignment.</p> <p>But there are other methods for centering block elements, the choice of which depends on what is being centered in relation to the outer container.</p> <h2>Line-height method</h2> <p>This method works when you want to center one line of text vertically. All you have to do is set the line height to be larger than the font size.</p> <p>Default <a href="https://gtavrl.ru/en/kak-udalit-programmu-s-kompyutera-vindovs-7-kogda-svobodnoe-prostranstvo-na/">free space</a> will be distributed evenly above and below the text. And the line will be centered vertically. Often the line height is made equal to the element height.</p> <h4>HTML:</h4> <p> <div id="parent"> <div id="child">Required text</div> </div></p> <h4>CSS:</h4> <p>#child ( line-height: 200px; )</p> <p>This method works in all browsers, although it can only be used for one line. The value 200 px in the example was chosen arbitrarily. You can use any value larger than the text font size.</p> <h2>Centering an Image Using Line-Height</h2> <p>What if the content is a picture? Will the above method work? The answer lies in one more line of CSS code.</p> <h4>HTML:</h4> <p> <div id="parent"> <img src='https://i2.wp.com/image.png' loading=lazy loading=lazy> </div></p> <h4>CSS:</h4> <p>#parent ( line-height: 200px; ) #parent img ( vertical-align: middle; )</p> <p>The value of the line-height property must be greater than the height of the image.</p> <h2>CSS Table Method</h2> <p>It was mentioned above that the vertical-align property is used for table cells, where it works great. We can display our element as a table cell and use the vertical-align property on it to vertically center the content.</p> <p><b>Note:</b> <a href="https://gtavrl.ru/en/css-vneshnyaya-tablica-stilei-nachinaetsya-so-stroki-vnedrenie-css-v-html-dokument/">CSS table</a> is not the same as an HTML table.</p> <h4>HTML:</h4> <p> <div id="parent"> <div id="child">Content</div> </div></p> <h4>CSS:</h4> <p>#parent (display: table;) #child ( display: table-cell; vertical-align: middle; )</p> <p>We set the table output to the parent div element and output the nested div element as a table cell. You can now use the vertical-align property on the inner container. Everything in it will be centered vertically.</p> <p>Unlike the method described above, in <a href="https://gtavrl.ru/en/chto-takoe-vneshnie-mehanicheskie-vozdeistviya-trenie-vneshnee/">in this case</a> the content can be dynamic as the div element will resize according to its content.</p> <p>The disadvantage of this method is that it does not work in older versions of IE. You have to use the display: inline-block property for the nested container.</p> <h2>Absolute positioning and negative margins</h2> <p>This method also works in all browsers. But it requires that the element being centered be given a height.</p> <p>The example code performs horizontal and vertical centering at the same time:</p> <h4>HTML:</h4> <p> <div id="parent"> <div id="child">Content</div> </div></p> <h4>CSS:</h4> <p>#parent (position: relative;) #child ( position: absolute; top: 50%; left: 50%; height: 30%; width: 50%; margin: -15% 0 0 -25%; )</p> <p>First, we set the element positioning type. Next, we set the nested div element's top and left properties to 50%, which corresponds to the center of the parent element. But the center is the top left corner of the nested element. Therefore, you need to lift it up (half the height) and move it to the left (half the width), and then the center will coincide with the center of the parent element. So knowing the height of the element in this case is necessary. Then we set the element with negative top and left margins equal to half the height and width, respectively.</p> <p>This method does not work in all browsers.</p> <h2>Absolute positioning and stretching</h2> <p>The example code performs vertical and horizontal centering.</p> <h4>HTML:</h4> <p> <div id="parent"> <div id="child">Content</div> </div></p> <h4>CSS:</h4> <p>#parent (position: relative;) #child ( position: absolute; top: 0; bottom: 0; left: 0; right: 0; width: 50%; height: 30%; margin: auto; )</p> <p>The idea behind this method is to stretch the nested element to all 4 borders of the parent element by setting the top, bottom, right, and left properties to 0.</p> <p>Setting the margins to auto-generate on all sides will set equal values ​​on all 4 sides and center our nested div element on its parent element.</p> <p>Unfortunately, this method does not work in IE7 and below.</p> <h2>Equal spaces above and below</h2> <p>In this method, equal padding is explicitly set above and below the parent element.</p> <h4>HTML:</h4> <p> <div id="parent"> <div id="child">Content</div> </div></p> <h4>CSS:</h4> <p>#parent ( padding: 5% 0; ) #child ( padding: 10% 0; )</p> <p>The example CSS code sets top and bottom padding for both elements. For a nested element, setting the padding will serve to vertically center it. And the parent element's padding will center the nested element within it.</p> <p>Relative units of measurement are used to dynamically resize elements. And for absolute units of measurement you will have to do calculations.</p> <p>For example, if the parent element has a height of 400px and the nested element is 100px, then 150px of padding is needed at the top and bottom.</p> <p>150 + 150 + 100 = 400</p> <p>Using % allows you to leave the calculations to the browser.</p> <p>This method works everywhere. <a href="https://gtavrl.ru/en/zapolnenie-pochtovogo-izveshcheniya-obratnaya-storona-pravilnoe/">Downside</a> is the need for calculations.</p> <p><b>Note:</b> This method works by setting the outer padding of an element. You can also use margins within an element. The decision to use margins or padding must be made depending on the specifics of the project.</p> <h2>floating div</h2> <p>This method uses an empty div element that floats and helps control the position of our nested element in the document. Note that the floating div is placed before our nested element in the HTML code.</p> <h4>HTML:</h4> <p> <div id="parent"> <div id="floater"></div> <div id="child">Content</div> </div></p> <h4>CSS:</h4> <p>#parent (height: 250px;) #floater ( float: left; height: 50%; width: 100%; margin-bottom: -50px; ) #child ( clear: both; height: 100px; )</p> <p>We offset the empty div to the left or right and set its height to 50% of its parent element. This way it will fill the top half of the parent element.</p> <p>Since this div is floating, it is removed from the normal flow of the document, and we need to unwrap the text on the nested element. The example uses clear: both , but it is quite enough to use the same direction as the offset of the floating empty div element.</p> <p>The top border of a nested div element is directly below the bottom border of an empty div element. We need to move the nested element up by half the height of the floating empty element. To solve the problem, use a negative margin-bottom property value for a floating empty div element.</p> <p>This method also works in all browsers. However, using it requires an additional empty div element and knowledge of the height of the nested element.</p> <h2>Conclusion</h2> <p>All methods described are easy to use. The difficulty is that none of them are suitable for all cases. You need to analyze the project and choose the one that suits <a href="https://gtavrl.ru/en/luchshaya-programma-zapisi-obrazov-iso-programmy-dlya-zapisi-obraza-na/">the best way</a> according to requirements.</p> <p>Hello, dear readers of the blog site. Today we continue to study and next up we have the properties text-decoration, vertical-align, text-align, text-indent and a number of others, which help to design the appearance of texts in Html code.</p><p>In the last article we looked at properties that are intended to customize the appearance of fonts when .</p><p>Well, even earlier we looked at all types in detail, learned how they can be grouped and what priorities the browser sets when interpreting them. True, all this was divided into several articles, so in order not to get confused, I advise you to study the materials in the order as given in.</p><h2>Text-decoration, text-align, text-indent in CSS</h2><p>How to work with text in Css? It would be logical to assume that there are specially designed rules for this purpose. Let's start with text-align, which is actually a replacement for the align attribute (it was used to align content like P paragraphs or headings).</p><p>It has only four possible meanings:</p><p>The meaning remains the same as before. <b><a href="https://gtavrl.ru/en/gorizontalnoe-i-vertikalnoe-vyravnivanie-blokov-css-polnoe/">Text align</a> </b>- this is the horizontal alignment of lines. This rule applies exclusively to block elements (paragraphs, headings, etc.), i.e. those tags in which several lines may appear. Because Since inline elements can only have one line, there is no particular point in using text-align in them.</p><p>It is clear that the values ​​of this rule mean alignment, respectively: left, right, center and page width (Justify - simultaneously left and right by increasing the distance between words) . It goes without saying that the Justify value should be used for elements with at least several lines of text, otherwise there will be no visible effect.</p><p>For example, I aligned <a href="https://gtavrl.ru/en/mirka-chat-geimerov-zakrytyi-kanal-ustanovka-i-nastroika-mirc-chto-to-ya/">previous paragraph</a> in width (you can see it has even borders on both the left and right), using:</p><p>Text-align:justify;</p><p>By default, horizontal text alignment is left, i.e. There is no need to specifically write text-align:left, unless, of course, you have previously specified a different alignment. By the way, I aligned this paragraph to the center (center) again for <a href="https://gtavrl.ru/en/kak-perezagruzit-windows-xp-iz-komandnoi-stroki-vyklyuchit-kompyuter-iz/">clear example</a>, but here, I think, everything is clear.</p><p>Next Css rule <b>text-indent</b> allows you to specify a red line, for example, for text in a paragraph tag P. The indentation of the red line can be specified by specifying a value (either with a plus sign or a minus sign, using ) or using percentages:</p><p><img src='https://i0.wp.com/ktonanovenkogo.ru/image/text-indent.png' height="66" width="282" loading=lazy loading=lazy></p><p>What are percentages calculated from in text-indent? From the width of the area allocated for text. Those. The CSS rule text-indent:50% will set a red line equal to half the length of this very line. Well, this paragraph serves as an example of such a rule.</p><p>Or you can, for example, set a negative value for the red line in text-indent and then we will get approximately what you see in this paragraph. For achievement <a href="https://gtavrl.ru/en/sortirovka-sql-server-rabota-s-bazoi-dannyh-sortirovka-dannyh-v/">this result</a> I wrote this for the paragraph tag P <a href="https://gtavrl.ru/en/edinicy-razmerov-pikseli-em-i-ex-i-nasledovanie-pravil-v-css/">CSS rule</a>:</p><p>Text-indent:-1em;</p><p>Well, a typical use of text-indent (to set the standard red line) might look like this: text-indent:40px; (applied to this paragraph, by the way). This rule, just like the text-align discussed earlier, <b>only applies to block elements</b>, i.e. where several lines may appear (paragraphs, headings, etc.).</p><p>Okay, now let's move on to <b>text-decoration</b>(design using a horizontal line), which is already applied to all Html elements (both inline and block).</p><p>It can have only four meanings:</p><p>Those. can be used using text-decoration: overline, line-through or underline, or use nothing at all (none). Some HTML elements already have a default design <a href="https://gtavrl.ru/en/razdelyayushchaya-liniya-html-kak-sozdat-raznye-varianty-gorizontalnoi/">horizontal line</a>, for example, (they are underlined by default).</p><p>Therefore, highlighting something else with underlining (except for hyperlinks) is not good, because users have it written in their subconscious that once it is underlined (and also highlighted in color), it means they can click on it to go. But by highlighting ordinary text with underlining, you mislead the user and subsequently become disappointed with your resource (he thought it was, but it turned out that...).</p><p>The nuance in using the Css text-decoration rule is that you can enter three (or two) values ​​at once for any Html element (omitting none) and as a result you will get <span>underlined-underlined-crossed out fragment of text</span>(sounds and looks cool, doesn’t it?):</p><p>Text-decoration:underline overline line-through;</p><p>Values ​​for <a href="https://gtavrl.ru/en/stil-podcherkivaniya-css-kak-ubrat-podcherkivanie-ssylki-text-decoration-style-stil-podcherkivani/">text decoration</a>(if you want to use several of them at once) you need to write <b>through a space character</b>.</p><h2>Vertical-align - vertical alignment</h2><p>Next we have vertical alignment - vertical-align. For almost all elements in HTML code, it means aligning inline elements with text relative to their baseline. True, for this it means a little different - all the content that is in these cells will be aligned vertically.</p><p>For the CSS vertical-align rule, you can use the following values:</p><p>Lines are baseline aligned by default. Look, I applied <span>increase the font size for this piece of text</span> and these two fragments are aligned to the base (bottom) line. And vertical alignment using vertical-align is precisely intended to change the way lines are aligned.</p><p>For example, if I write vertical-align:baseline for the same enlarged piece of text, then no changes will occur, because the baseline value is used for this CSS rule by default.</p><p>By the way, you can also use numbers as values ​​for it, and the inscription vertical-align:0 will mean the same thing as vertical-align:baseline, i.e. baseline is equivalent to zero. Therefore, if we want to indicate any shift in vertical alignment, then this shift will be specified relative to the baseline (or zero).</p><p>You can write it like this:</p><p>vertical-align:10px;</p><p>And we will receive <span>shift the fragment with larger font up</span> 10 pixels relative to the baseline. If we write a negative value:</p><p>Vertical-align:-10px;</p><p>Then we get <span>shift fragment down</span> relative to the baseline. From the examples it is clear that due to the shift, the height of the line increased so that the text fits in it without colliding with the adjacent line. The shift can also be specified in Em and Ex, and as a percentage, which will be calculated from the line height of this element (remember in the last article we learned how to set it using ).</p><p>To vertically align the contents of table cells, vertical-align should use the Top and Bottom values ​​to respectively align the content to the top and bottom of the cell (well, middle in a table cell is used as the default vertical alignment value).</p><p>And for font elements you can use text-top, text-bottom, middle. Let's use it as an example <span>this piece of text</span> meaning:</p><p>vertical-align:middle;</p><p>What was the result? The middle line of the enlarged fragment is aligned with the baseline of the regular text, i.e. we got vertical alignment to the centerline. For text-top and text-bottom everything will be the same. This is text-top , and this is text-bottom .</p><p>The values ​​of the Css property vertical-align sub and super correspond to the sub- and super-index that took place in pure Html (before using <a href="https://gtavrl.ru/en/vse-selektory-i-svoistva-css-vidy-css-selektorov-dlya-vseh-elementov/">CSS properties</a> for visual design).</p><h2>Text-transform, letter-spacing, word-spacing and white-space</h2><p>None is used by default and means that the characters in the text will not change in any way - as written in Html, this is how they will be displayed. The Uppercase value for text-transform will transform all letters in the fragment to capital letters ( <span>an example is shown in this sentence</span>, where the text-transform:uppercase rule was used, and the letters were originally written in lowercase).</p><p>The lowercase value for the Css text-transform rule will allow you to transform all characters in the fragment to lowercase, and the capitalize value will make all the first letters of the word capitalize ( <span>example in this sentence</span>- text-transform:capitalize). Those. using text-transform you can do anything you want with plain text, and then easily return everything back.</p><p>Therefore, if, for example, you have the task of making all headings written only in capital letters, then write them in Html as usual, and make them capital letters in CSS via text-transform:uppercase. Then, if you decide to change something back, you only need to make a small change to the styles, and not to the content of all 100,500 headers on your site.</p><p><img src='https://i0.wp.com/ktonanovenkogo.ru/image/letter-spacing.png' height="91" width="358" loading=lazy loading=lazy></p><p>By default, both letter-spacing and word-spacing are set to Normal, or this is the same as zero (i.e., the distance between characters and words does not change in any way). The amount of change in distance in these rules can only be specified in pixels, either Em or Ex, but not in percentages.</p><p>However, you can use both positive (sparseness of characters or words) and negative values ​​(bringing characters or words closer together). For example, you can <span>“this is how to thin out the characters in this phrase”</span> using the following Css rule:</p><p>Letter-spacing:0.4em;</p><p>Or you can <span>“this is how to bring the symbols in this phrase closer together”</span> by using:</p><p>Letter-spacing:-1px;</p><p>The same can be said about word-spacing, with the only difference being that the distance will change between words, <span>as, for example, in this phrase, using this CSS construct</span>:</p><p>Word-spacing:4em;</p><p>Similarly, you can use negative values ​​in word-spacing to reduce the distance between words.</p><p>Well, the last CSS rule for today, which allows you to format text in Html code in a certain way, is this <b>white-space</b>. It is responsible for displaying whitespace characters on the web page that occurred when <a href="https://gtavrl.ru/en/poshlyi-rules-html-pravila-postroeniya-html-dokumentov-pravila/">writing HTML</a> code.</p><p>As you remember from the article about, the browser, when parsing the code, combines all spaces, line breaks and tabs into one single space, and breaks lines on the web page exactly according to <a href="https://gtavrl.ru/en/kakaya-kombinaciya-klavish-dobavlyaet-nerazryvnyi-probel/">whitespace characters</a>, which took place in the code.</p><p>So, white space can take one of three values:</p><p><img src='https://i2.wp.com/ktonanovenkogo.ru/image/white-space.png' width="100%" loading=lazy loading=lazy></p><p>It is clear that the default value is Normal and in this case everything is displayed as I described just above. But when using the Pre value, we get a complete analogy with using, i.e. On the web page, the text will be displayed with all those extra whitespace characters that were present when writing the code, and the browser will no longer be able to make transfers using them.</p><p>Well, what's the meaning? <b>nowrap</b> will simply prevent the browser from wrapping those whitespace characters that it finds inside the fragment with <a href="https://gtavrl.ru/en/pravila-postroeniya-html-dokumentov-kak-sdelat-luchshe-pravila-oformleniya/">CSS rule</a> white-space:nowrap. You can try how it all works yourself by creating a simple Html file and enclosing any piece of text in tags like this:</p><p> <div style="white-space:pre;">fragment of experimental text</div> </p><p>Good luck to you! See you soon on the pages of the blog site</p><blockquote>You can watch more videos by going to</blockquote>");"><br><img src='https://i0.wp.com/ktonanovenkogo.ru/wp-content/uploads/video/image/parkur-kadr.jpg' width="100%" loading=lazy loading=lazy><p>You might be interested</p><p><img src='https://i2.wp.com/ktonanovenkogo.ru/wp-content/uploads/2013/10/list-style.jpg' width="100%" loading=lazy loading=lazy><span>List style (type, image, position) - Css rules for customizing the appearance of lists in Html code</span> <br><img src='https://i1.wp.com/ktonanovenkogo.ru/wp-content/uploads/2013/10/z-index-cursor.jpg' width="100%" loading=lazy loading=lazy><span>Positioning using Z-index and CSS Cursor rule to change the mouse cursor</span> <br><img src='https://i0.wp.com/ktonanovenkogo.ru/wp-content/uploads/2013/10/padding-margin-border.jpg' width="100%" loading=lazy loading=lazy><span>Padding, Margin and Border - set in <a href="https://gtavrl.ru/en/css-svechenie-bloka-vnutrennie-teni-v-css/">CSS internal</a> and external margins, as well as frames for all sides (top, bottom, left, right)</span> <br><img src='https://i0.wp.com/ktonanovenkogo.ru/wp-content/uploads/2013/10/uroki-css.jpg' width="100%" loading=lazy loading=lazy><span>What is CSS for, how to connect cascading style sheets to <a href="https://gtavrl.ru/en/kak-vstavit-izobrazhenie-v-html-dokument-vstavka-izobrazhenii-v-html-dokument/">HTML document</a> and the basic syntax of this language</span> <br><img src='https://i0.wp.com/ktonanovenkogo.ru/wp-content/uploads/2013/10/float-clear.jpg' width="100%" loading=lazy loading=lazy><span>Float and clear in CSS - block layout tools</span> <br><img src='https://i2.wp.com/ktonanovenkogo.ru/wp-content/uploads/2013/10/css.jpg' width="100%" loading=lazy loading=lazy><span>CSS - what is it, how do cascading style sheets connect to <a href="https://gtavrl.ru/en/chernyi-cvet-kod-html-uchebnik-html-cveta-rgb-cveta-bezopasnoi-palitry/">HTML code</a> using Style and Link</p> <script>document.write("<img style='display:none;' src='//counter.yadro.ru/hit;artfast_after?t44.1;r"+ escape(document.referrer)+((typeof(screen)=="undefined")?"": ";s"+screen.width+"*"+screen.height+"*"+(screen.colorDepth? screen.colorDepth:screen.pixelDepth))+";u"+escape(document.URL)+";h"+escape(document.title.substring(0,150))+ ";"+Math.random()+ "border='0' width='1' height='1' loading=lazy loading=lazy>");</script> </div><div class="clear"></div> <script type="text/javascript"> document.getElementById('hc_full_comments').innerHTML = ''; </script><br /><br /><noindex><p align="center"><center> <div id="meta_news_block1111" style="text-align: center;"></div></center> </p> <br /><br /> <p align="center"> </p> </noindex> </div> </div> <div id="sidebar"> <div class="clear"></div><br /> <h2 class="front" style="margin:15px 0 5px 0">Popular articles</h2> <div class="tabcont"> <ol> <li><a href="https://gtavrl.ru/en/plastikovye-karty-internet-i-domashnee-televidenie-v-petrozavodske-karelii/">Internet and home television in Petrozavodsk, Karelia and the Murmansk region - “Citylink” • Topping up your account with a bank card Instructions for making a purchase in Citylink</a></li> <li><a href="https://gtavrl.ru/en/vk-publichnaya-stranica-chto-otlichiya-pablika-ot-gruppy-vkontakte-funkcionalnost-i-oformlenie/">Differences between a public page and a VKontakte group</a></li> <li><a href="https://gtavrl.ru/en/deshevye-8-yadernye-smartfony-polza-v-marketinge/">Cheap 8 core smartphones</a></li> <li><a href="https://gtavrl.ru/en/istoriya-televideniya-izobretateli-pervyi-opyt-televeshchaniya-televidenie/">Inventors, first experience of television broadcasting</a></li> <li><a href="https://gtavrl.ru/en/kak-pomenyat-temu-vkontakte-gde-skachat-i-kak-pomenyat-temu-v-vk-get-stail/">Where to download and how to change the theme in VK?</a></li> </ol> </div> <h2 class="front" style="margin:15px 0 5px 0">Latest articles</h2> <div class="tabcont"> <ol> <li><a href="https://gtavrl.ru/en/platforma-dlya-socialnoi-zhurnalistiki-para-soobrazhenii-o/">A couple of thoughts about blocking Kont and the lazy people from Roskomnadzor Kont political platform</a></li> <li><a href="https://gtavrl.ru/en/pulty-dlya-distancionnogo-upravleniya-obektami-osnovnye-organy/">Basic controls and functions of a mixing console Remote control diagram</a></li> <li><a href="https://gtavrl.ru/en/htc-one-m7-tehnicheskie-harakteristiki-kommunikaciya-mezhdu-ustroistvami-v-mobilnyh-setyah-osushchestvlya/">Communication between devices in mobile networks is carried out using technologies that provide different data transfer rates</a></li> <li><a href="https://gtavrl.ru/en/kak-sdelat-rezervnuyu-kopiyu-efs-na-samsung-galaxy-s3-ispolzuya-metod-v-odin-klik/">Recovering EFS encrypted files and folders Recovering efs</a></li> <li><a href="https://gtavrl.ru/en/skrinshot-stranicy-na-telefone-kak-na-telefone-sdelat-skrinshot-ekrana/">How to take a screenshot of the screen on your phone: methods and instructions</a></li> <li><a href="https://gtavrl.ru/en/sbrasyvanie-iphone-do-zavodskih-nastroek-sbros-nastroek-i-polnyi/">Factory reset and hard reset Apple iPhone Full reset iphone 5s to factory settings</a></li> <li><a href="https://gtavrl.ru/en/kak-nastroit-email-na-android-kak-nastroit-pochtu-na/">How to set up mail on Android</a></li> </ol> </div> <div class="widget" id="ajdg_grpwidgets-3"> <div class="g g-9"> <div class="g-single a-27"> <script> jQuery(function() { window.onscroll = function() { height_scroll = jQuery(document).scrollTop(); height = jQuery(document).height(); height50 = height / 2; if (height_scroll >= height50) { jQuery("#site-code-block-22").fadeIn(1200); document.getElementById('site-code-block-22').style.display = 'block'; jQuery("#site-code-block-23").fadeOut(1200); document.getElementById('site-code-block-23').style.display = 'none'; } else { jQuery("#site-code-block-22").fadeOut(1200); document.getElementById('site-code-block-22').style.display = 'none'; document.getElementById('site-code-block-23').style.display = 'block'; jQuery("#site-code-block-23").fadeIn(1200); } }; }); </script> <div class="site-code-block prma-count" data-rel="cb_23" id="site-code-block-23" style=""> </div> <div class="site-code-block prma-count" data-rel="cb_22" id="site-code-block-22" style=""> </div> </div> </div> </div> <div class="clear"></div> <br /> <center> <div style="color: #333333; font-size: 11px;"> </div> </center> <div class="clear"></div> </div> <div class="clear"></div> </div> </div> </div>  <br /><br /> <div id="footeri"> <div id="footer"> <div class="footer-sec"> <h6>Sections</h6> <ul> <li><a href="https://gtavrl.ru/en/category/youtube/">Youtube</a></li> <li><a href="https://gtavrl.ru/en/category/facebook/">Facebook</a></li> <li><a href="https://gtavrl.ru/en/category/twitter/">Twitter</a></li> <li><a href="https://gtavrl.ru/en/category/tips/">Adviсe</a></li> <li><a href="https://gtavrl.ru/en/category/useful-tips/">Useful tips</a></li> <br /> </ul> </div> <div class="footer-sec"> <h6>Pages</h6> <ul> <li><a href="">about the project</a></li> <noindex> <li><a href="" >RSS news</a></li> </noindex> </ul><br /><br /><br /> <h6>Special projects</h6> <ul> <li><a href="https://gtavrl.ru/en/feedback/">Connect with us</a></li> </ul> </div> <div id="footer-top"> <h6>Contacts</h6> <ul> <li><a href="">Advertising on the website</a></li> <li><a href="https://gtavrl.ru/en/feedback/">Contacts</a></li> </div> <div class="clear"></div> </div></div> <div id="bottom"><div class="foot_col1">2024 <a href="https://gtavrl.ru/en/">gtavrl.ru</a>. </div> <script type="text/javascript">var addthis_config = { "data_track_addressbar":true,"pubid": "ra-58b68bb0f1371607"} ;addthis_config.data_track_addressbar = false;addthis_config.data_track_clickback = false;</script> <script type='text/javascript'> var flag_hide = 0; function hide_direct() { flag_hide = 1; jQuery('#rek_mob_fixed').slideToggle( 'slow' ); var date = new Date(); var expires_hour = 21600000; date.setTime(date.getTime()+expires_hour); showSocial(); Cookies.set('advp_show_me', '1', { expires: date, path: '/'} ); } ; jQuery(function(f){ var element = f('#rek_mob_fixed'); element.delay(8000); f(window).scroll(function(){ if (flag_hide == 0){ var offset_element_for_hide = jQuery('#before_footer').val(); if (offset_element_for_hide != null) { offset_element_for_hide = jQuery('#before_footer'); offset_element_for_hide = jQuery(offset_element_for_hide).offset().top - jQuery(window).height(); } else { offset_element_for_hide = jQuery(document).height(); } //Если рекламный блок более 1000px по ширине, устанавливай фикс. ширину 1000px if (jQuery('#rek_mob_fixed_block').actual('width') >1000) { jQuery('#rek_mob_fixed_block').css({ 'max-width':'1000px'} ); } if(f(this).scrollTop() > 500){ element.fadeIn(0); } if(f(this).scrollTop() < 500 || f(this).scrollTop() > offset_element_for_hide ){ element.fadeOut(0) } if(f(this).scrollTop() + f(this).height() >= f(document).height() && flag_hide == 0 && jQuery('#rek_mob_fixed').is(':visible')) { jQuery('#rek_mob_fixed').slideToggle(100); } } } ); } ); function showSocial(){ if(flag_hide == 1 ) jQuery('#footer-share').slideToggle('slow'); } </script><div id="wondergridgallerylightbox_options" data-skinsfoldername="skins/default/" data-jsfolder="/wp-content/plugins/modesco-wonderplugin-gridgallery/engine/" style="display:none;"></div> <script type='text/javascript' src='https://gtavrl.ru/wp-content/plugins/contact-form-7/includes/js/scripts.js?ver=4.9.2'></script> <script type='text/javascript' src='https://gtavrl.ru/wp-content/plugins/modesco-monica/script.min.js?ver=4.9.1'></script> <script type='text/javascript'> /* <![CDATA[ */ var tocplus = { "visibility_show":"\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c","visibility_hide":"\u0441\u043a\u0440\u044b\u0442\u044c","width":"100%"} ; /* ]]> */ </script> <script type='text/javascript' src='https://gtavrl.ru/wp-content/plugins/modesco-table-of-contents-plus/front.js?ver=1404'></script> <script type='text/javascript' src='https://gtavrl.ru/wp-content/plugins/page-links-to/js/new-tab.min.js?ver=2.9.8'></script> <script type='text/javascript'> var q2w3_sidebar_options = new Array(); q2w3_sidebar_options[0] = { "sidebar" : "ads-sidebar", "margin_top" : 10, "margin_bottom" : 50, "stop_id" : "before_footer", "screen_max_width" : 0, "screen_max_height" : 0, "width_inherit" : false, "refresh_interval" : 1500, "window_load_hook" : false, "disable_mo_api" : false, "widgets" : ['ajdg_grpwidgets-3'] } ; </script> <script type='text/javascript' src='https://gtavrl.ru/wp-content/plugins/q2w3-fixed-widget/js/q2w3-fixed-widget.min.js?ver=5.0.4'></script> <script type='text/javascript' src='https://gtavrl.ru/wp-content/plugins/youtube-embed-plus/scripts/fitvids.min.js?ver=4.9.1'></script> <script type='text/javascript' src='/wp-includes/js/wp-embed.min.js?ver=4.9.1'></script> <script type="text/javascript"> var _hcwp = _hcwp || []; var _hcobj = { widget_id : 29264, widget : "Bloggerstream",selector: '.hc_counter_comments',platform:"wordpress", } ; _hcwp.push(_hcobj); (function() { if("HC_LOAD_INIT" in window)return; HC_LOAD_INIT = true; var lang = "ru"; var hcc = document.createElement("script"); hcc.type = "text/javascript"; hcc.async = true; hcc.src = ("https:" == document.location.protocol ? "https" : "http")+"://w.hypercomments.com/widget/hc/29264/"+lang+"/widget.js"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hcc, s.nextSibling); } )(); </script> </body> </div> </body> </html>