Last active
October 10, 2020 01:36
-
-
Save rob-kistner/c642394fdcd583daf851da76f625280b to your computer and use it in GitHub Desktop.
Various CSS
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
| /* | |
| CSS Box Borders | |
| Borders will thicken the interior of containers by default. This means, in a case where there are more than one column next to each other, the containers meet will be double thickness. You can make them single thickness by removing the right border on all neighboring containers except the last one with `:not(:last-child)`. | |
| */ | |
| .col { | |
| border: solid 5px red; | |
| } | |
| .col:not(:last-child) { | |
| border-right: none; | |
| } |
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
| /* | |
| Flexbox Images | |
| -------------- | |
| Images in a flexbox container will, by default, stretch to fill the container. This is due to flexbox's align-self value on items of 'stretch' by default. Changing this value to something else prevents the image from stretching. | |
| */ | |
| .col { | |
| display: flex; | |
| flex-direction: column; | |
| } | |
| .col img { | |
| align-self: center; | |
| max-width: 100%; | |
| } | |
| @media (min-width: 500px) { | |
| .col { | |
| width: 33.332%; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment