YouTip LogoYouTip

Css3 Pr Overflow Style

# CSS3 overflow-style Property The `overflow-style` property is a CSS3 feature designed to specify the preferred scrolling method for elements with overflowing content. --- ## Introduction When an element's content exceeds its specified dimensions, the `overflow` property determines whether to clip the content, render scrollbars, or display the overflow. The `overflow-style` property was introduced to give developers more granular control over *how* that scrolling behavior is presented and controlled (e.g., using traditional scrollbars, a panning tool, or marquee-style automatic scrolling). > ⚠️ **Important Compatibility Note:** The `overflow-style` property was part of early CSS3 drafts (specifically the CSS Multi-column Layout and CSS Basic Box modules) but was never widely adopted. Currently, **no major modern browsers support this property**. It is considered obsolete or experimental. For production environments, standard `overflow` properties (like `overflow: auto` or `overflow: scroll`) should be used instead. --- ## Syntax ```css overflow-style: auto | scrollbar | panner | move | marquee; ``` ### Property Values You can specify a single value or a comma-separated list of values in order of preference. The browser will use the first method in the list that it supports. | Value | Description | | :--- | :--- | | `auto` | The default value. The browser determines the best scrolling method for the platform. | | `scrollbar` | Displays a traditional scrollbar for the overflowing element. | | `panner` | Displays a panning interface (often a 2D viewport map) to navigate the content. | | `move` | Allows the user to directly grab and drag the content to scroll (similar to touch-dragging or hand-tool panning). | | `marquee` | The content scrolls automatically without requiring user interaction. | --- ## Property Details | Feature | Value / Behavior | | :--- | :--- | | **Default Value:** | `auto` | | **Inherited:** | No | | **Animatable:** | No (See (css-animatable.html)) | | **Version:** | CSS3 | | **JavaScript Syntax:** | `object.style.overflowStyle = "scrollbar";` | --- ## Code Examples ### Example 1: Setting Preferred Scrolling Methods In this example, we tell the browser to handle overflow automatically, but we prefer a `marquee` effect if supported. If `marquee` is not supported, the browser should fall back to a `panner` interface. ```css div { width: 300px; height: 150px; overflow: auto; /* Preferred scrolling methods in order of priority */ overflow-style: marquee, panner; } ``` --- ## Browser Support As of today, major desktop and mobile browsers do not support the `overflow-style` property: * ❌ Internet Explorer / Edge * ❌ Firefox * ❌ Chrome * ❌ Safari * ❌ Opera ### Modern Alternatives If you need to achieve behaviors described by `overflow-style` today, use these modern, widely-supported alternatives: * **For `scrollbar` / `move`:** Use standard `overflow: auto` or `overflow: scroll`. For touch-drag behaviors, browsers handle this natively on mobile, or you can use CSS properties like `overflow-behavior` and `scroll-snap-type`. * **For `marquee`:** Use CSS `@keyframes` animations to translate text or content across the screen.
← Misc WhenSel Multipleattribute Equal Va β†’