Proprietà CSS mask-origine
Esempio
Usando mask-origin: border-box;
e 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;
}
Altri esempi "Provalo da solo" di seguito.
Definizione e utilizzo
La mask-origin
proprietà specifica la posizione di origine (l'area di posizione della maschera) di un'immagine del livello della maschera.
Valore di default: | scatola di confine |
---|---|
Ereditato: | no |
Animabile: | no. Leggi su animabile |
Versione: | CSS3 |
sintassi JavaScript: | oggetto .style.maskOrigin="padding-box" |
Supporto browser
I numeri nella tabella specificano la prima versione del browser che supporta completamente la proprietà.
I numeri seguiti da -webkit- specificano la prima versione che ha funzionato con un prefisso.
Property | |||||
---|---|---|---|---|---|
mask-origin | 4.0 -webkit- | 79.0 -webkit- | 53.0 | 4.0 -webkit- | 15.0 -webkit- |
Sintassi CSS
mask-origin:
border-box|content-box|padding-box|margin-box|fill-box|stroke-box|view-box|initial|inherit;
Valori di proprietà
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 |
Altri esempi
Esempio
Usando mask-origin: border-box;
e 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;
}
Pagine correlate
Riferimento CSS: proprietà mask-image
Riferimento CSS: proprietà in modalità maschera
Riferimento CSS: proprietà mask-position
Riferimento CSS: proprietà mask-repeat
Riferimento CSS: proprietà mask-size
Tutorial CSS: Mascheratura CSS