Skip to content

Instantly share code, notes, and snippets.

@aravindbaskaran
Created March 16, 2020 11:05
Show Gist options
  • Save aravindbaskaran/c84d4feebe2dbc94914951570cf41e46 to your computer and use it in GitHub Desktop.
Save aravindbaskaran/c84d4feebe2dbc94914951570cf41e46 to your computer and use it in GitHub Desktop.
Media query free layout options
//Option 1 - With flex
.Product-wrapper {
display: flex;
justify-content: space-around;
max-width: min(80%, 1080px);
.Product {
margin-bottom: 30px;
flex: 1 1 280px;
}
}
//Option 2 - With grid
.Product-wrapper {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
justify-content: space-around;
max-width: min(80%, 1080px);
grid-gap: 1rem;
.Product {
margin-bottom: 30px;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment