CSS:Exemple de positionnement flottant

Un article de WikiTuto.

Jump to: navigation, search

Définition

<div style="float:right;border-style:solid;">droit n°1</div>
 <div style="float:right;border-style:solid;">droit n°2</div>
 <div style="float:left;border-style:solid;">gauche n°1</div>
 <div style="float:right;border-style:solid;">droit n°3</div>
 <div style="float:left;border-style:solid;">gauche n°2</div>
 <div style="float:right;border-style:solid;">droit n°4</div>
 <div style="float:left;border-style:solid;">gauche n°3</div>

ce qui donne ceci :

Ou encore ceci, quand la fenêtre est trop étroite :

La propriété clear (avec les valeurs both, right et left) a pour effet de terminer une série de flottants et faire recommencer le flux sur la ligne suivante.

Source

Dominique Gonzalez

Voir aussi

  1. Positionnement et affichage explications
  2. propriété clear
  3. Exemple de positionnement flottant
  4. Affichage
Boîte à outils
Annuaire gratuitCe site est listé dans la catégorie Informatique : Aide et astuces en informatique Annuaire