Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bootstrap row pseudo elements usage

Im wondering and dont know the answer for Bootstrap Grid row using Display:table and content:"" for their pseudo elements(after and before) . Why it is using display table there .

.row:after,.row:before{
display:table;
}

Can anyone explain why they using ?

like image 794
Arun Avatar asked Sep 07 '26 23:09

Arun


1 Answers

.row:before, .row:after { display: table; }

This is supported by all browsers except for IE(6/7). It generates a pseudo-element before and after the content of the element that contains floats. Setting display: table creates an anonymous table-cell and a new block formatting context. This acts to prevent top-margin collapse and improve the consistency between modern browsers and IE(6/7).

like image 174
Md. Samsuzzoha Avatar answered Sep 10 '26 19:09

Md. Samsuzzoha