ComputersInformation Technology

Overflow CSS: displaying the content of an element

Tables of cascading styles are easy to use if you do not go into the jungle of inheritance, prioritization, class structure, theoretical moments and practical experience.

The main purpose of each CSS property is to display, but this does not mean only "visible": the "CSS Overflow hidden" design is equally important.

Page Elements

The page contains not only elements, elements of elements can be located on it, be it frames (and this can be not only a set of components, but another site as a whole) or hand-made systems of objects.

Naturally, the overwhelming number of website developers practicing rubber imposition, are forced to reckon with the growing volumes of information and the fact that the barrier of 800 by 600 pixels is not a barrier in 640 KB, which overcame the mentality of the creators of MS DOS for several decades, making life hard for programmers and users First personalk.

In the site building, everything is simpler: the page does not fit on the screen, the browser does it scrolling. Although the developer can provide the output of the page content to the window without scroll bars and without other properties: the contents of the page will never come out of the window selected. This is natural, outside the window there are other applications, and the browser window is no better than other windows: the operating system always stands for equality of applications.

However, no matter how the priorities were set in the choice of the layout option, no matter how the interest of visitors was distributed to the optimal resolution of the screen for browsing the sites, today there are different screens that do not always have rectangular fixed-size capabilities.

A dynamic world through Overflow CSS

It is accepted that the page of the site is the content decomposed by hypertext tags that indicate how to display it in this or that situation under certain conditions.

Everything is constantly changing. Even if the site is such that its content can not be changed for many years, there is no guarantee that an unexpected visitor will not open it on a new device, which the developer of this site did not even guess.

There are only four options for properties for the Overflow CSS rule : it is possible to hide everything that goes beyond the scope of the element, display, provide scrolling always or only as necessary, or inherit the value from the ancestor.

In the first case (overflow: hidden), all the content that goes beyond the element will be hidden, and what is hidden will not be available. This position is effective, but no less interesting is the option to show everything that goes beyond (overflow: visible). So the developer gives the visitor the opportunity to always have an idea of the full content of the element and manage its volume. Smaller possibilities are given by scrolling (overflow: scroll - there are always scrollbars, or overflow: auto - scrollbars appear as needed).

How to use the Overflow rule

", представляют особенный интерес, только когда они представляют собой текст. The elements that are inside the tag, meaning the CSS "text overflow ", are of particular interest only when they represent text. The placement of other components, as a rule, is fixed by coordinates or by relative positions.

Text elements do not always contain a fixed number of characters, and if you need to use the overflow rule , CSS is instructed to control the options for an unexpected change in the amount of content.

In particular, during the debugging phase, you can apply the value of the auto or scroll properties, and then block the display of anything that goes beyond the scope, giving the visitor a set of buttons that will move invisible content to the visible area. This is common practice. Not all are impressed by the scroll bar, some prefer it four buttons: to the beginning, forward, back, to the end.

In addition, the rule overflow CSS in the value of auto / scroll brings to the page an element of unpleasant uncertainty: the browser takes priority in the scrolling from the page to its element when the mouse pointer is over it.

When an element is a text block, it is not too noticeable and inconvenient, but if you place a slider across the whole width of the window (block of image elements), you can not always overcome this design by the mouse, often you have to use the "to the beginning" or "to the end pages".

Scrolling Priorities

The dialogue of the site page with the visitor is of great importance, as is its design, development, content. Since the site opens the browser and does it in its own window or a separate tab, then most likely the right to scrolling should have a page, not its element. The latter can not only be many, but each can have its own function.

The site always carries a specific meaning, even if it refers to the field of philosophy, mysticism or other unforeseen content. That's why you can always assume a specific dialog load on elements with the rule overflow CSS.

In particular, if the element is the selector of the year (date) selection, the classic selector will be inconvenient, and its scroll bar will cause obvious inconvenience. Applying overflow in this case, CSS can be effectively used in addition: internal fields in the element, allocate periods, provide an opportunity for the visitor to quickly and conveniently set the desired number, month, year.

Similar articles

 

 

 

 

Trending Now

 

 

 

 

Newest

Copyright © 2018 en.atomiyme.com. Theme powered by WordPress.