CSS - Float

  • The "float" parameter in CSS allows an element to be pushed to the left or right, allowing other elements to wrap around it.
  • A floated element will move as far to the left or right as it can. Usually this means all the way to the left or right of the containing element.
  • The elements after the floating element will flow around it.
  • The elements before the floating element will not be affected
     Eg: .img
{
float:right;
}


  • If you place several floating elements after each other, they will float next to each other if there is room.

Turning the CSS Float Off - Clear attribute


  • Elements after the floating element will flow around it. To avoid this, use the clear property.
  • The clear property specifies which sides of an element other floating elements are not allowed. 
    Eg:
.text_line
{
clear:both;
}

Reference :

  W3c Help

Clear Example in Stack Overflow

Comments

Popular posts from this blog

'jasypt.encryptor.password' or one of ['jasypt.encryptor.privateKeyString', 'jasypt.encryptor.privateKeyLocation'] must be provided for Password-based or Asymmetric encryption

Field or property 'jobParameters' cannot be found on object of type 'org.springframework.beans.factory.config.BeanExpressionContext' - Spring Batch

Couldn't store job: Unable to serialize JobDataMap for insertion into database because the value of property 'jobLauncher' is not serializable