Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

css
clear
html
communitycreator

What is the CSS clear property?

Behzad Ahmad

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

The clear property in CSSCascade Style Sheets controls the flow when using the float property. It specifies what will happen to the elements next to the floating elements.

Syntax


clear: none|left|right|both|initial|inherit;

Property values

  • none: This is the default value.

  • left: It is used to push the elements below the left floated elements.

  • right: It pushes the elements below the right floated elements.

  • both: It to pushes the elements below the right and left floated elements.

  • initial: This sets the value to its default value.

  • inherit: This is used to inherit property from its parent value.

Code

The following is the basic HTMLHyperText Markup Language and CSS code to demonstrate the use of the clear property.

RELATED TAGS

css
clear
html
communitycreator

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring