Propiedad de posición de máscara CSS
Ejemplo
Establezca la posición de la imagen de la capa de máscara en el centro:
.mask1 {
-webkit-mask-image: url(w3logo.png);
mask-image: url(w3logo.png);
-webkit-mask-size: 50%;
mask-size: 50%;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
-webkit-mask-position: center;
mask-position: center;
}
Más ejemplos de "Pruébelo usted mismo" a continuación.
Definición y uso
La mask-position
propiedad establece la posición inicial de una imagen de máscara (en relación con el área de posición de la máscara).
Sugerencia: De forma predeterminada, se coloca una imagen de máscara en la esquina superior izquierda de un elemento y se repite tanto vertical como horizontalmente.
Valor por defecto: | 0% 0% |
---|---|
Heredado: | No |
Animable: | No. Leer sobre animable |
Versión: | CSS3 |
Sintaxis de JavaScript: | objeto .style.maskPosition="100px centro" |
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-position | 4.0 -webkit- | 79.0 -webkit- | 53.0 | 4.0 -webkit- | 15.0 -webkit- |
Sintaxis CSS
mask-position: value;
Valores de propiedad
Value | Description |
---|---|
left top left center left bottom right top right center right bottom center top center center center bottom |
If you only specify one keyword, the other value will be "center" |
x% y% | The first value is the horizontal position and the second value is the vertical. The top left corner is 0% 0%. The right bottom corner is 100% 100%. If you only specify one value, the other value will be 50%. Default value is: 0% 0% |
xpos ypos | The first value is the horizontal position and the second value is the vertical. The top left corner is 0 0. Units can be pixels (0px 0px) or any other CSS units. If you only specify one value, the other value will be 50%. You can mix % and positions |
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
Establezca la posición de la imagen de la capa de máscara en la esquina inferior derecha:
.mask1 {
-webkit-mask-image: url(w3logo.png);
mask-image: url(w3logo.png);
-webkit-mask-size: 50%;
mask-size: 50%;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
-webkit-mask-position: 100% 100%;
mask-position: 100% 100%;
}
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 origen de la máscara
Referencia CSS: propiedad mask-repeat
Referencia CSS: propiedad de tamaño de máscara
Tutorial CSS: Enmascaramiento CSS