How To Use Float And Clear.

Forums CSSHow To Use Float And Clear.
Staff asked 2 years ago

How to use float and clear.

Answers (1)

Add Answer
Ashish Kakadiya Marked As Accepted
Staff answered 2 years ago

For float :

float  is a positioning property in css used to float an element to the left or right corner of parent element and the next element or text wrapping around the left or right to it .

Example :

<style>
   img{
        float: left;  
      }
</style>

 

try this syntax  :-
float: none | left | right | initial | inherit;

For clear  :

clear property is used to stop next element to wrap around the adjacent floating elements. Clear can have clear left,right and both values.

Example :
<style>
      img{
           clear: both;
        }
</style>
try this syntax :-
clear: none| right| left | both;

Subscribe

Select Categories