RE: What are the various clearing techniques and which is appropriate for what context?

What are the various clearing techniques and which is appropriate for what context?

chayan Senior Developer Asked on June 5, 2018 in CSS.
Add Comment
1 Answers

 Empty Div Method:

<div style=”clear:both;”></div>

Overflow Method:

setting auto or hidden overflow property on parent will expand it to contain the floats.

The Psuedo Method:

uses the parent’s :after to add the clear: both property


.clearfix:after {

content: "";

visibility: hidden;

display: block;

height: 0;

clear: both;

}

Default Answered on December 4, 2018.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.