Last active
January 18, 2020 02:34
-
-
Save clausti/1b9978a5de7344df42b3da19760e7c58 to your computer and use it in GitHub Desktop.
css grid align-items bug??
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
<div class='a-post-card-hack'> | |
<div class='cn-body'>I'm pretending to be a content note</div> | |
<div class='post-inner'>I'm pretending to be a post</div> | |
</div> |
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
.a-post-card-hack { | |
display: grid; | |
.cn-body { | |
grid-column: 1; /* it can be just 1 or it can be 1/2, or it can be 1/-1 */ | |
grid-row: 1/2; /* it appears not to matter as long as the divs are on top of one another */ | |
display: grid; /* this way buggy */ | |
display: flex; /* this way works */ | |
align-items: center; | |
padding-top: 1.99rem; /* this div needs LESS TOTAL HEIGHT to break the vertical alignment */ | |
padding-bottom: 2rem; | |
} | |
.post-inner { | |
grid-column: 1/-1; | |
grid-row: 1 ; | |
padding-top: 2rem; | |
padding-bottom: 2rem; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment