Question:
What defines a "scrolling box" in the context of CSS Positioned Layout?
Answer:
According to the CSS Positioned Layout Module Level 3 (Working Draft), a scrolling box is determined by the overflow property. If an element has its overflow set to a value other than visible, it becomes a scrolling box.
Implementation:
To switch on or off the scrolling behavior of a box, modify its overflow property. Setting it to visible removes scrolling, while other values, such as auto, hidden, or scroll, enable it.
For example, in the following code:
<div class="wrapper"> <div>
If .wrapper has its overflow set to hidden, the inner div will become a scrolling box. Conversely, if .wrapper's overflow is set to visible, the inner div will no longer scroll.
The above is the detailed content of What Makes an Element a Scrolling Box in CSS Positioned Layout?. For more information, please follow other related articles on the PHP Chinese website!