Created
October 12, 2013 03:15
-
-
Save owlsky/6945364 to your computer and use it in GitHub Desktop.
perfectly-justified-css-grid-technique-using-inline-block
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.wrapper{ | |
width: 550px; | |
text-align: justify; | |
background: firebrick; | |
font-size: 0; | |
font-size: 12px\9; /* IE6-9 only hack */ | |
} | |
.wrapper div{ | |
background: white; | |
display: inline-block; | |
font-size: 12px; | |
zoom: 1; | |
*display: inline; | |
} | |
.wrapper:after{ | |
content: ""; | |
width: 100%; | |
display: inline-block; | |
zoom: 1; | |
*display: inline; | |
} |
If you put pointer-event: none;
on the :after
pseudo-element it should prevent the pseudo-element from interfering with anything below.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I love this technique... It would be even more neat if there was a way to achieve clicking through to content below the pseudo-element... I tried setting CSS rules for the
:after
element asheight: 0;
, and/ormax-height: 0;
, and alsovisibility: none
... I wonder if there's a way to hack it somehow? It's not being overridden by anything else in my CSS either