Propiedad de origen de máscara CSS
Ejemplo
Usando mask-origin: border-box;
y mask-origin:
content-box;
:
.mask1 {
width: 600px;
height: 400px;
background: green;
border: 20px solid red;
padding:
50px;
-webkit-mask-image: url(w3logo.png);
mask-image:
url(w3logo.png);
-webkit-mask-size: 80%;
mask-size: 80%;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
-webkit-mask-origin: border-box;
mask-origin: border-box;
}
.mask2 {
width: 600px;
height: 400px;
background: green;
border: 20px solid red;
padding: 50px;
-webkit-mask-image:
url(w3logo.png);
mask-image: url(w3logo.png);
-webkit-mask-size:
80%;
mask-size: 80%;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
-webkit-mask-origin: content-box;
mask-origin: content-box;
}
Más ejemplos de "Pruébelo usted mismo" a continuación.
Definición y uso
La mask-origin
propiedad especifica la posición de origen (el área de posición de la máscara) de una imagen de capa de máscara.
Valor por defecto: | cuadro de borde |
---|---|
Heredado: | No |
Animable: | No. Leer sobre animable |
Versión: | CSS3 |
Sintaxis de JavaScript: | objeto .style.maskOrigin="caja de relleno" |
Compatibilidad con navegador
Los números de la tabla especifican la primera versión del navegador que es totalmente compatible con la propiedad.
Los números seguidos de -webkit- especifican la primera versión que funcionó con un prefijo.
Property | |||||
---|---|---|---|---|---|
mask-origin | 4.0 -webkit- | 79.0 -webkit- | 53.0 | 4.0 -webkit- | 15.0 -webkit- |
Sintaxis CSS
mask-origin:
border-box|content-box|padding-box|margin-box|fill-box|stroke-box|view-box|initial|inherit;
Valores de propiedad
Value | Description |
---|---|
border-box | The position is relative to the border box. This is default |
content-box | The position is relative to the content box |
padding-box | The position is relative to the padding box |
margin-box | The position is relative to the margin box |
fill-box | The position is relative to the object bounding box |
stroke-box | The position is relative to the stroke bounding box |
view-box | Use the nearest SVG viewport as reference box |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Más ejemplos
Ejemplo
Usando mask-origin: border-box;
y mask-origin:
content-box;
:
.mask1 {
width: 600px;
height: 400px;
background: green;
border: 20px solid red;
padding:
50px;
-webkit-mask-image: url(w3logo.png);
mask-image:
url(w3logo.png);
-webkit-mask-size: 80%;
mask-size: 80%;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
-webkit-mask-origin: border-box;
mask-origin: border-box;
}
.mask2 {
width: 600px;
height: 400px;
background: green;
border: 20px solid red;
padding: 50px;
-webkit-mask-image:
url(w3logo.png);
mask-image: url(w3logo.png);
-webkit-mask-size:
80%;
mask-size: 80%;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
-webkit-mask-origin: content-box;
mask-origin: content-box;
}
páginas relacionadas
Referencia de CSS: propiedad de imagen de máscara
Referencia de CSS: propiedad de modo de máscara
Referencia de CSS: propiedad de posición de máscara
Referencia CSS: propiedad mask-repeat
Referencia CSS: propiedad de tamaño de máscara
Tutorial CSS: Enmascaramiento CSS