- CSS Tutorial
- CSS - Home
- CSS - Introduction
- CSS - Syntax
- CSS - Selectors
- CSS - Inclusion
- CSS - Measurement Units
- CSS - Colors
- CSS - Backgrounds
- CSS - Fonts
- CSS - Text
- CSS - Images
- CSS - Links
- CSS - Tables
- CSS - Borders
- CSS - Border Block
- CSS - Border Inline
- CSS - Margins
- CSS - Lists
- CSS - Padding
- CSS - Cursor
- CSS - Outlines
- CSS - Dimension
- CSS - Scrollbars
- CSS - Inline Block
- CSS - Dropdowns
- CSS - Visibility
- CSS - Overflow
- CSS - Clearfix
- CSS - Float
- CSS - Arrows
- CSS - Resize
- CSS - Quotes
- CSS - Order
- CSS - Position
- CSS - Hyphens
- CSS - Hover
- CSS - Display
- CSS - Focus
- CSS - Zoom
- CSS - Translate
- CSS - Height
- CSS - Hyphenate Character
- CSS - Width
- CSS - Opacity
- CSS - Z-Index
- CSS - Bottom
- CSS - Navbar
- CSS - Overlay
- CSS - Forms
- CSS - Align
- CSS - Icons
- CSS - Image Gallery
- CSS - Comments
- CSS - Loaders
- CSS - Attr Selectors
- CSS - Combinators
- CSS - Root
- CSS - Box Model
- CSS - Counters
- CSS - Clip
- CSS - Writing Mode
- CSS - Unicode-bidi
- CSS - min-content
- CSS - All
- CSS - Inset
- CSS - Isolation
- CSS - Overscroll
- CSS - Justify Items
- CSS - Justify Self
- CSS - Tab Size
- CSS - Pointer Events
- CSS - Place Content
- CSS - Place Items
- CSS - Place Self
- CSS - Max Block Size
- CSS - Min Block Size
- CSS - Mix Blend Mode
- CSS - Max Inline Size
- CSS - Min Inline Size
- CSS - Offset
- CSS - Accent Color
- CSS - User Select
- CSS Advanced
- CSS - Grid
- CSS - Grid Layout
- CSS - Flexbox
- CSS - Visibility
- CSS - Positioning
- CSS - Layers
- CSS - Pseudo Classes
- CSS - Pseudo Elements
- CSS - @ Rules
- CSS - Text Effects
- CSS - Paged Media
- CSS - Printing
- CSS - Layouts
- CSS - Validations
- CSS - Image Sprites
- CSS - Important
- CSS - Data Types
- CSS3 Tutorial
- CSS3 - Tutorial
- CSS - Rounded Corner
- CSS - Border Images
- CSS - Multi Background
- CSS - Color
- CSS - Gradients
- CSS - Box Shadow
- CSS - Box Decoration Break
- CSS - Caret Color
- CSS - Text Shadow
- CSS - Text
- CSS - 2d transform
- CSS - 3d transform
- CSS - Transition
- CSS - Animation
- CSS - Multi columns
- CSS - Box Sizing
- CSS - Tooltips
- CSS - Buttons
- CSS - Pagination
- CSS - Variables
- CSS - Media Queries
- CSS - Functions
- CSS - Math Functions
- CSS - Masking
- CSS - Shapes
- CSS - Style Images
- CSS - Specificity
- CSS - Custom Properties
- CSS Responsive
- CSS RWD - Introduction
- CSS RWD - Viewport
- CSS RWD - Grid View
- CSS RWD - Media Queries
- CSS RWD - Images
- CSS RWD - Videos
- CSS RWD - Frameworks
- CSS References
- CSS - Questions and Answers
- CSS - Quick Guide
- CSS - References
- CSS - Color References
- CSS - Web browser References
- CSS - Web safe fonts
- CSS - Units
- CSS - Animation
- CSS Resources
- CSS - Useful Resources
- CSS - Discussion
CSS - scrollbar-gutter Property
CSS scrollbar-gutter property allows developers to create a fixed space for the scrollbar.
Possible Values
-
auto − Default value. The browser will automatically create a gutter if a scrollbar is needed.
-
stable − The browser will always reserve space for the scrollbar, even if it is not needed.
-
both-edges − The browser reserves the space for a scrollbar on both the inline start and end edges of the element.
Applies to
Scrolling boxes.
DOM Syntax
object.style.scrollbarGutter: "auto|stable|both-edges";
CSS Scrollbar Gutter - Auto Value
The following example demonstrates how to use scrollbar-gutter: auto property to create an element with a scrollbar that will only appear if the content of the element overflows its container −
<html> <head> <style> .scroll-gutter-auto { margin: 10px; width: 300px; height: 190px; overflow: auto; scrollbar-gutter: auto; background-color: #F1EFB0; } h3 { color: #DC4299; } </style> </head> <body> <div class="scroll-gutter-auto"> <h3>overflow: auto and scrollbar-gutter: auto</h3> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. Lorem Ipsum is simply dummy text of the printing and typesetting industry. </div> </body> </html>
CSS Scrollbar Gutter - Stable Value
The following example demonstrates how to use the scrollbar-gutter: stable to make a scrollbar always visible, even if the content fits in the container −
<html> <head> <style> .scroll-gutter-scroll { margin: 10px; width: 350px; height: 210px; overflow: scroll; scrollbar-gutter: stable; background-color: #F1EFB0; } h3 { color: #DC4299; } </style> </head> <body> <div class="scroll-gutter-scroll"> <h3>overflow: scroll and scrollbar-gutter: stable</h3> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type. Lorem Ipsum is simply dummy text. </div> </body> </html>
The following example demonstrates how to use the scrollbar-gutter: stable to hide any content that goes beyond the edges of a container, while still keeping a space for a scrollbar −
<html> <head> <style> .scroll-gutter-hidden { margin: 10px; width: 350px; height: 150px; overflow: hidden; scrollbar-gutter: stable; background-color: #F1EFB0; } h3 { color: #DC4299; } </style> </head> <body> <div class="scroll-gutter-hidden"> <h3>overflow: hidden and scrollbar-gutter: stable</h3> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type. Lorem Ipsum is simply dummy text of the printing and typesetting industry dummy text ever since the 1500s. </div> </body> </html>
CSS Scrollbar Gutter - Both-edges Value
The following example demonstrates how to use the CSS property scrollbar-gutter: stable both-edges to make a scrollbar always visible at both the edges, even if the content of the element fits within its container −
<html> <head> <style> .scroll-gutter-both-edges { margin: 10px; width: 370px; height: 220px; overflow: scroll; scrollbar-gutter: stable both-edges; background-color: #F1EFB0; } h3 { color: #DC4299; } </style> </head> <body> <div class="scroll-gutter-both-edges"> <h3>overflow: hidden and scrollbar-gutter: stable both-edges</h3> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type. </div> </body> </html>