A HyperText Markup Language (HTML) scrollbar is a user interface element that can appear within the viewable frame displaying an HTML document. It allows a user to move the viewable region of an area of the screen while leaving surrounding areas untouched. In many instances, an HTML scrollbar can be generated automatically by the HTML document viewer, although certain HTML and cascading style sheet (CSS) codes can either force a scrollbar to be displayed or can force one to be hidden. Within a web page, an HTML scrollbar can be a defined formatting solution in the event of a content overflow, or it can be a property that can be set on frames displayed within the main window. It is important to note that an HTML scrollbar that appears within a rendered HTML document is different from the operating system graphical user interface (GUI) scrollbar element that is controlled by the web browser, although some operations also can modify the appearance of the browser scrollbar.
When rendered inside an HTML document, an HTML scrollbar has the general appearance of the default system scrollbar GUI element. This usually is a vertical or horizontal bar that has arrows placed on each end. The bar, which also is called the track, then has a box on top that represents the currently viewed area of the larger document or area. The scrollbar can be manipulated by clicking on the arrows with the mouse cursor to move the displayed area, or by directly dragging the viewable indicator box along the track.
When a region such as a frame is defined in HTML or with CSS, the expected amount of space in pixels sometimes is not available because of a different screen resolution or window size. This causes an overflow to occur, meaning that text, images and other elements are not able to be fully displayed in the available space. One behavior that can be specified in an HTML document is for the renderer to create an HTML scrollbar so a user can move to different non-visible parts of the area in a limited space. Alternately, the scroll bar can be disabled, meaning that if only part of an image or block of text is displayed, the non-visible areas simply will not be shown and no indication that they exist will be evident.
Through the use of CSS, an HTML scrollbar can have its appearance customized. This usually means changing the sequence of colors that are used to draw the bar, its highlights and its shadows. With the use of scripting languages and some non-standard coding, the actual graphics that are used to display an HTML scrollbar can be changed for a more customized appearance, although not all browsers or operating systems support this functionality.