Stile chiaro Proprietà
Esempio
Proibisci oggetti fluttuanti sul lato sinistro del testo in un elemento:
document.getElementById("demo").style.clear = "left";
Definizione e utilizzo
La proprietà clear imposta o restituisce la posizione dell'elemento rispetto agli oggetti mobili.
Supporto browser
Property | |||||
---|---|---|---|---|---|
clear | Yes | Yes | Yes | Yes | Yes |
Sintassi
Restituisce la proprietà clear:
object.style.clear
Imposta la proprietà clear:
object.style.clear = "none|left|right|both|initial|inherit"
Valori di proprietà
Value | Description |
---|---|
none | Allows floating objects on both sides of the element. This is default |
left | No floating objects allowed on the left side of the element |
right | No floating objects allowed on the right side of the element |
both | No floating objects allowed on either the left or right side of the element |
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: | nessuno |
---|---|
Valore di ritorno: | Una stringa, che rappresenta la posizione di un elemento rispetto agli oggetti fluttuanti |
Versione CSS | CSS1 |
Altri esempi
Esempio
Restituisce la proprietà clear:
alert(document.getElementById("demo").style.clear);
Pagine correlate
Tutorial CSS: CSS Float
Riferimento CSS: proprietà clear
❮ Oggetto stile