Last active
June 20, 2022 14:20
-
-
Save divienginesupport/2b61ce2db0109abd77d4a983e160b21c to your computer and use it in GitHub Desktop.
align the last element of the grid at horizontal center
This file contains hidden or 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
/* THIS FIRST RULE IS TO CHANGE THE BEHAVIOUR OF THE GRID */ | |
.grid-posts.loop-grid { | |
display: flex; | |
flex-wrap: wrap; | |
justify-content: center; | |
} | |
/* THIS SECOND RULE SETS THE SIZE OF EACH ELEMENT PER ROW. PLEASE ADD ONLY THE RIGHT ONE YOU NEED */ | |
/* TWO ELEMENTS PER ROW*/ | |
.grid-posts.loop-grid .grid-col { | |
flex: 0 0 48%; | |
} | |
/* THREE ELEMENTS PER ROW*/ | |
.grid-posts.loop-grid .grid-col { | |
flex: 0 0 31%; | |
} | |
/* IF YOU WANT TO ADD THIS RULE ONLY TO A SPECIFIC LOOP. PLEASE HEAD OVER TO YOUR ADVANCED MOUDULE SETTINGS | |
AND THEN SET AN ID VALUE FOR YOUR MODULE. AFTER THAT PUT THE CSS RULES INDICATED ABOVE LIKE THIS: */ | |
/* THE FOLLOWING RULES ARE ONLY SPECIFIC TO my-custom-loop ID */ | |
#my-custom-loop .grid-posts.loop-grid { | |
display: flex; | |
flex-wrap: wrap; | |
justify-content: center; | |
} | |
#my-custom-loop .grid-posts.loop-grid .grid-col { | |
flex: 0 0 48%; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment