Propriedade clara de estilo
Exemplo
Proibir objetos flutuantes no lado esquerdo do texto em um elemento:
document.getElementById("demo").style.clear = "left";
Definição e uso
A propriedade clear define ou retorna a posição do elemento em relação aos objetos flutuantes.
Suporte ao navegador
Property | |||||
---|---|---|---|---|---|
clear | Yes | Yes | Yes | Yes | Yes |
Sintaxe
Retorne a propriedade clear:
object.style.clear
Defina a propriedade clear:
object.style.clear = "none|left|right|both|initial|inherit"
Valores de propriedade
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 |
Detalhes técnicos
Valor padrão: | Nenhum |
---|---|
Valor de retorno: | Uma String, representando a posição de um elemento em relação a objetos flutuantes |
Versão CSS | CSS1 |
Mais exemplos
Exemplo
Retorne a propriedade clear:
alert(document.getElementById("demo").style.clear);
Páginas relacionadas
Tutorial CSS: CSS Flutuante
Referência CSS: propriedade clara
❮ Objeto de estilo