Last active
June 7, 2021 11:37
-
-
Save DanielFloeter/eaf5afecd23786e8f2957559ab8515eb to your computer and use it in GitHub Desktop.
CSS :nth-child() selector for a responsive column layout
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
/* Food menu- and drinks columns */ | |
.wp-block-column { | |
padding-top: 2em; | |
margin-left: 0 !important; | |
} | |
@media (min-width: 600px) and (max-width: 781px) { | |
.wp-block-column { | |
margin-top: 1em; | |
} | |
} | |
.wp-block-column:nth-child(odd) { | |
background-color: #701122; | |
color: #fffdef; | |
padding-left: 1.5em; | |
} | |
.wp-block-column:nth-child(odd) h2 { | |
color: #fffdef; | |
} | |
.wp-block-column:nth-child(even), | |
.wp-block-column:nth-child(even) h2 { | |
background-color: #fffdef; | |
color: #701122; | |
padding-left: 1.5em; | |
} | |
dt { | |
font-weight: normal; | |
margin-bottom: 1.5em; | |
} | |
dd{ | |
text-align: right; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment