I came across the clearfix implementation below.
What could be the reason for the choice of the attribute selector (div[class="foobar"]
)? I cannot figure out any good reason for it. Why didn't the author use div.foobar
?
div.foobar:after {
content: " . ";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
div.foobar {
display: inline-block;
}
div[class="foobar"] {
display: block;
}
* html div.foobar {
height: 1%;
}