Propiedad CSS background-clip
Ejemplo
Especifique hasta dónde debe extenderse el fondo dentro de un elemento:
div
{
border: 10px dotted black;
padding: 15px;
background:
lightblue;
background-clip:
padding-box;
}
Definición y uso
La background-clip
propiedad define hasta dónde debe extenderse el fondo (color o imagen) dentro de un elemento.
Valor por defecto: | cuadro de borde |
---|---|
Heredado: | No |
Animable: | No. Leer sobre animable |
Versión: | CSS3 |
Sintaxis de JavaScript: | objeto .style.backgroundClip="contenido-box" |
Compatibilidad con navegador
Los números de la tabla especifican la primera versión del navegador que es totalmente compatible con la propiedad.
Property | |||||
---|---|---|---|---|---|
background-clip | 4.0 | 9.0 | 4.0 | 3.0 | 10.5 |
Sintaxis CSS
background-clip: border-box|padding-box|content-box|initial|inherit;
Valores de propiedad
Value | Description | Play it |
---|---|---|
border-box | Default value. The background extends behind the border | |
padding-box | The background extends to the inside edge of the border | |
content-box | The background extends to the edge of the content box | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
páginas relacionadas
Tutorial CSS: Fondos CSS
Referencia HTML DOM: propiedad backgroundClip