Propriedade de limpeza CSS
Exemplo
O elemento <p> é colocado abaixo dos elementos flutuantes à esquerda (o elemento <p> não permite elementos flutuantes no lado esquerdo):
img
{
float: left;
}
p.clear
{
clear: left;
}
Definição e uso
A clear
propriedade controla o fluxo próximo aos elementos flutuantes.
A clear
propriedade especifica o que deve acontecer com o elemento que está próximo a um elemento flutuante.
Dica: Veja também o imóvel.
float
Valor padrão: | Nenhum |
---|---|
Herdado: | não |
Animavel: | não. Leia sobre animáveis |
Versão: | CSS1 |
Sintaxe JavaScript: | objeto .style.clear="both" |
Suporte ao navegador
Os números na tabela especificam a primeira versão do navegador que oferece suporte total à propriedade.
Property | |||||
---|---|---|---|---|---|
clear | 1.0 | 5.0 | 1.0 | 1.0 | 6.0 |
Sintaxe CSS
clear: none|left|right|both|initial|inherit;
Valores de propriedade
Value | Description |
---|---|
none | Default. The element is not pushed below left or right floated elements |
left | The element is pushed below left floated elements |
right | The element is pushed below right floated elements |
both | The element is pushed below both left and right floated elements |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Páginas relacionadas
Tutorial CSS: CSS Flutuante
Referência HTML DOM: propriedade clear