Last active
May 13, 2020 16:45
-
-
Save nathansmith/2be17178cf3c77a86e87fde64c435f68 to your computer and use it in GitHub Desktop.
Example of auto layout flexbox, with reverse order
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-parent { | |
align-items: center; | |
display: flex; | |
flex-direction: row-reverse; | |
flex-wrap: wrap; | |
margin-left: auto; | |
margin-right: auto; | |
max-width: 1200px; | |
} | |
.flex-item { | |
flex-basis: 50%; | |
flex-grow: 1; | |
min-width: 300px; | |
} |
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-parent"> | |
<figure class="flex-item"> | |
<img | |
alt="Double rainbow" | |
src="./image.png" | |
/> | |
<figcaption> | |
What does it mean? | |
</figcaption> | |
</figure> | |
<!-- .flex-item --> | |
<div class="flex-item"> | |
<p> | |
The image will be on the right, on desktop. | |
</p> | |
<p> | |
But it will stack first, for mobile width. | |
</p> | |
</div> | |
<!-- .flex-item --> | |
</div> | |
<!-- .flex-parent --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment