A Pen by Laura Kajpust on CodePen.
Last active
July 23, 2018 21:05
-
-
Save delusioninabox/9b8bfa02f6f2ed734700691968b101ab to your computer and use it in GitHub Desktop.
Flex box buttons example
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="flex"> | |
<div class="button">One button</div> | |
<div class="button">This one is super long and stuff.</div> | |
<div class="button">Three</div> | |
<div class="button">4</div> | |
<div class="button">THis one is ok.</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
.flex { | |
display: flex; | |
flex-wrap: nowrap; | |
margin: 1rem auto; | |
width: 100%; | |
max-width: 800px; | |
} | |
.flex .button { | |
font-family: sans-serif; | |
appearance: none; | |
flex-grow: 1; | |
background: #333; | |
color: #FFF; | |
padding: 0.5rem; | |
border-radius: 5px; | |
text-align: center; | |
max-width: 100px; | |
margin: 1rem auto; | |
display: flex; | |
justify-content: center; | |
flex-direction: column; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment