Last active
January 17, 2023 12:26
-
-
Save ihorduchenko/eec442b3c89b0f80a65dd5574a7c7018 to your computer and use it in GitHub Desktop.
Force certain column to change it's position on desktop outside of the flow
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
<!-- https://prnt.sc/f05LCS_YIdZq --> | |
<div class="product-hero"> | |
<div class="product-media__wrapper"> | |
Product media | |
</div> | |
<div class="product__info"> | |
Product info | |
</div> | |
<div class="product-media__accordion"> | |
Product accordion | |
</div> | |
</div> | |
<style> | |
@media (min-width: 1000px) { | |
.product-hero { | |
display: grid; | |
grid-template-columns: 1fr 1fr; | |
} | |
.product-hero .product-media__wrapper { | |
grid-row: 1 / auto; | |
grid-column: 1 / 2; | |
} | |
.product-hero .product__info { | |
grid-row: 1 / 20; /* Here is the trick to stretch the left columns */ | |
grid-column: 2 / 3; | |
} | |
.product-hero .product-media__accordion { | |
grid-row: auto / auto; | |
grid-column: 1 / 2; | |
} | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment