Proprietà clip stile
Esempio
Taglia un'immagine in una forma specificata:
document.getElementById("myImg").style.clip = "rect(0px 75px 75px 0px)";
Definizione e utilizzo
La proprietà clip imposta o restituisce quale parte di un elemento posizionato è visibile.
Supporto browser
Property | |||||
---|---|---|---|---|---|
clip | Yes | Yes | Yes | Yes | Yes |
Sintassi
Restituisce la proprietà della clip:
object.style.clip
Imposta la proprietà della clip:
object.style.clip = "auto|rect(top right bottom left)|initial|inherit"
Valori di proprietà
Value | Description |
---|---|
auto | Default. The element does not clip |
rect(top right bottom left) | Clips the shape defined by the four coordinates |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Dettagli tecnici
Valore di default: | auto |
---|---|
Valore di ritorno: | Una stringa, che rappresenta la parte visibile di un elemento posizionato |
Versione CSS | CSS2 |
Altri esempi
Esempio
Restituisce la proprietà della clip:
alert(document.getElementById("myImg").style.clip);
Pagine correlate
Tutorial CSS: Posizionamento CSS
Riferimento CSS: proprietà clip
❮ Oggetto stile