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

/* Keyword values */
overflow-clip-box-inline: padding-box;
overflow-clip-box-inline: content-box;
/* Global values */
overflow-clip-box-inline: inherited;
overflow-clip-box-inline: initial;
overflow-clip-box-inline: unset;
					

注意 : 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!

句法

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 .

形式句法

Syntax not found in DB!
					

范例

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-inline: 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);
					

结果

规范

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 .

浏览器兼容性

The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Edge Mobile Firefox for Android Opera for Android Safari on iOS Samsung Internet
overflow-clip-box-inline 非标 Chrome 不支持 No Edge 不支持 No Firefox 完整支持 59 IE 不支持 No Opera 不支持 No Safari 不支持 No WebView Android 不支持 No Chrome Android 不支持 No Edge Mobile 不支持 No Firefox Android 完整支持 59 Opera Android 不支持 No Safari iOS 不支持 No Samsung Internet Android 不支持 No

图例

完整支持

完整支持

不支持

不支持

非标。预期跨浏览器支持较差。

非标。预期跨浏览器支持较差。

另请参阅

元数据

  • 最后修改: