HTML DOM Style backgroundClip Property
-- Learning is not just about technology, but also about dreams!
- Home
- HTML
- JavaScript
- CSS
- Vue
- React
- Python3
- Java
- C
- C++
- C#
- AI
- Go
- SQL
- Linux
- VS Code
- Bootstrap
- Git
- Local Bookmarks
JavaScript Reference Manual
JavaScript Objects
- JavaScript Array Object
- JavaScript Boolean Object
- JavaScript Date Object
- JavaScript Math Object
- JavaScript Number Object
- JavaScript String Object
- JavaScript RegExp Object
- JavaScript Global Properties/Functions
- JavaScript Operators
- JavaScript Error
Browser Objects
DOM Objects
- HTML DOM Document Object
- HTML DOM Element Object
- HTML DOM Attribute Object
- HTML DOM Event Object
- HTML DOM Console Object
- CSSStyleDeclaration Object
- DOM HTMLCollection
HTML Objects
- <a>
- <area>
- <audio>
- <base>
- <blockquote>
- <body>
- <button>
- <canvas>
- <col>
- <colgroup>
- <datalist>
- <del>
- <details>
- <dialog>
- <embed>
- <fieldset>
- <form>
- <iframe>
- <frameset >
- <img>
- <ins>
- <input> - button
- <input> - checkbox
- <input> - color
- <input> - date
- <input> - datetime
- <input> - datetime-local
- <input> - email
- <input> - file
- <input> - hidden
- <input> - image
- <input> - month
- <input> - number
- <input> - range
- <input> - password
- <input> - radio
- <input> - reset
- <input> - search
- <input> - submit
- <input> - text
- <input> - time
- <input> - url
- <input> - week
- <keygen>
- <link>
- <label>
- <legend>
- <li>
- <map>
- <menu>
- <menuItem>
- <meta>
- <meter>
- <object>
- <ol>
- <optgroup>
- <option>
- <param>
- <progress>
- <q>
- <script>
- <select>
- <source>
- <style>
- <table>
- <td>
- <th>
- <tr>
- <textarea>
- <title>
- <time>
- <track>
- <video>
Style backgroundClip Property
Example
Specify the background drawing area:
document.getElementById("myDIV").style.backgroundClip="content-box";
Definition and Usage
The background-clip property sets or returns the background drawing area.
Browser Support
The backgroundClip property is supported in Internet Explorer 9+, Firefox, Opera, Chrome, and Safari.
Note: Internet Explorer 8 and earlier versions do not support the backgroundClip property.
Syntax
Return the backgroundClip property:
_object_.style.backgroundClip
Set the backgroundClip property:
_object_.style.backgroundClip="border-box|padding-box|content-box|initial|inherit"
Property Values
| Value | Description |
|---|---|
| border-box | Default value. Background is clipped to the border box. |
| padding-box | Background is clipped to the padding box. |
| content-box | Background is clipped to the content box. |
| initial | Sets this property to its default value. See initial. |
| inherit | Inherits this property from its parent element. See inherit. |
Technical Details
| Default Value: | border-box |
|---|---|
| Return Value: | A string, representing the background-clip property of an element. |
| CSS Version: | CSS3 |
Related Articles
CSS Reference: background-clip property
ByteDance Coding Plan supports mainstream large models such as Doubao, GLM, DeepSeek, Kimi, MiniMax, etc., officially supplied, stable and reliable. Configuration Guide Β₯9.9/month Subscribe Now
YouTip