CSS - Clear

Clear

The clear property in CSS is used to set what happens to the next element following the floated element.

It is used when you want the next element to be below the floated element instead of at the right or left side (depending on the float value). Its values include:

  • left
  • right
  • both
  • none
  • inherit

If the floated element is bigger that the containing element, it will overflow outside its container. To fix this, we set the overflow value to auto

ADVERTISEMENTS

LEARNING IS A CONTINOUS PROCESS - PRACTICE MAKES PERFECT