CSS float

Float

The CSS float property is used to make content wrap. It's usually used on pictures to make text wrap around them, much like in books and magazines

The CSS float property can have one of three values: 'none,' 'left,' or 'right'

Float keeps on floating until it reaches the end of the element it is applied to. If we need to stop floating, we can use the CSS clear property on the element we want to stop floating. Clear can have one of four values: 'none,' 'left,' 'right,' or 'both'

Use the controls on the right to see how the float property affects image elements and the clear property affects paragraphs

CSS Code

.img1 {
   float: left;    margin: 10px; /* I add a little margin to set the text off from the image */
}

or

.img1 {
   float: right;
   margin: 10px;
}

.clear-both {
   clear: both;
}

Example

lotr 1 1. Nó aiwë remba tundo apa, hat nó ohtatyaro nortalarta. Vírë vailë rá hen. Yanen hopassë mirilya nir na, tuv vaxë úcarë lindë mí

gandalf 2. Hérë larca sí mir, ter mí halda aryon. Oi alma findë nuquéra már, halda vacco na ilu. .

3. San or valinor hlonítë, histë valarauko ela or. Us nahamna simpina avamarwa sir, cú lauta hesta calacaltasisílafaina sac. Namna nahamna carcassë na úrë, histë rámië laito wán lá. Nyéni linwelë voronwë uë nir, racinë haltacapa silninquita en yen. Ma tixë rondë wen, sí san núta valinor, mardo litsë rangwë mí oar. Mí tyávë lindë ciryapanda mól.

4. Nó túr talan haloitë artaquetta, lir et celë ataqua, tixë salmë sa órë. Mi ilu aiwë palmë, íta ta valda hecil orofarnë, ná assa lissë canta nís. Nís up omentië telpina. Mí aman marda nér. Mear pereldar lav er, nië ré lápa arca lanta, lis three ringsup varnë vestina mettarë. Mi lië fion amorta.

5. Terca hérincë ambarenya ama ve, tuo an caima hesta turúva. Pendë amanyar us epë, rempa alatúvëaúra lú ela. Sú vén fánë hlar tenna, ma car tárië telpina, men úr onóro holmë. Hón ehtë minda arnanor uë, costa liéva valarauko oa yav, sac ta ettë inqua. Ai fárë carca minda oar.

6. Ara yarë cenvéla lavralda as, nolya fassë aicassë tó nal. Sa tuv cemna etelotya, at rata mitya norna oli, mírëa avatyara ta vië. Palmë timpinen pé yén, sai atacar taniquelassë na. Sar métima hantalë ré, an cotumo vandel áva, nís venë tanwëataquë ná. Capië suhto andamunda yav sa, ai harna amorta maquetta ana, pé sai cíla naraca yernacolla.

Controls