overflow-clip-box-block

The overflow-clip-box-block CSS property specifies relative to which box the clipping happens when there is an overflow — in the block direction.

/* Keyword values */
overflow-clip-box-block: padding-box;
overflow-clip-box-block: content-box;

/* Global values */
overflow-clip-box-block: inherited;
overflow-clip-box-block: initial;
overflow-clip-box-block: unset;

Note: On Gecko, by default, padding-box is used everywhere, but <input type="text"> and similar use the value content-box. Note that this property is activated by default only in the UA stylesheet and chrome contexts.

Value not found in DB!

Syntax

Values

padding-box
This keyword makes the clipping be related to the padding box.
content-box
This keyword makes the clipping be related to the content box.

Formal syntax

Syntax not found in DB!

Examples

padding-box

HTML

<div class="things">
  <input value="ABCDEFGHIJKLMNOPQRSTUVWXYZÅÄÖ" class="scroll padding-box">
  <div class="scroll padding-box"><span>ABCDEFGHIJKLMNOPQRSTUVWXYZÅÄÖ</span></div>
</div>

CSS

.scroll { 
  overflow: auto;
  padding: 0 30px; 
  width: 6em; 
  border: 1px solid black;
  background: lime content-box;
}

.padding-box {
  overflow-clip-box-block: padding-box;
}

JavaScript

function scrollSomeElements() {
  var elms = document.querySelectorAll('.scroll');
  for (i=0; i < elms.length; ++i) {
    elms[i].scrollLeft=80;
  }
}
var elt = document.queryElementsByTagName('body')[0];

elt.addEventListener("load", scrollSomeElements, false);

Result

Specifications

This property has been proposed to the W3C CSSWG; it is not yet on the standard track but, if accepted, should appear in CSS Overflow Module Level 3.

Browser compatibility

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Firefox (Gecko) Chrome Internet Explorer Opera Safari (WebKit)
Basic support 59 (59)[1] No support No support No support No support
Feature Firefox Mobile (Gecko) Android IE Phone Opera Mobile Safari Mobile
Basic support 59.0 (59)[1] No support No support No support No support

[1] This property is controlled by the layout.css.overflow-clip-box.enabled preference, which defaults to false. It only is activated inside UA stylesheets and the chrome context. See bug 966992.

See also

 

Document Tags and Contributors

 Contributors to this page: chrisdavidmills, SphinxKnight
 Last updated by: chrisdavidmills,