How do you make a clearfix that clears the space between inline-block divs inside a wrapper?
<div class="parent">
<div class="child"></div>
<div class="child"></div>
<div>
Applying font-size: 0;
on the parent element works on desktop browser, but not with iOS Safari.
Using comments between each child works really well, but it's not looking good in the DOM.
So I figured a clearfix would make itself some use here, but I can't get it to work, because ::after
is not applying after the children, it's stuck inside the div.
.child:after {
content: "";
display: table;
clear: both;
}
Is there any way of removing the unwanted margins between inline-blocks that works on both iPhones Safari and Desktop browsers?