|
|
|
<h1>Grid 'auto-fill' vs 'auto-fit'</h1> |
|
<p class="sub-text"> Resize the screen to see the difference.</p> |
|
<h2> auto-fill: Grid items won't expand even if there is available space. </h2> |
|
<p class="code">grid-template-columns: repeat(auto-fill, minmax(300px,1fr));</p> |
|
<div class="grid grid--fill"> |
|
<div class="grid__child"> |
|
<img src="https://images.unsplash.com/photo-1498654896293-37aacf113fd9?ixlib=rb-1.2.1&auto=format&fit=crop&w=1050&q=80" alt="Korean side dishes"> |
|
<div class="text"> |
|
<div class="timing"> |
|
<span class="ma-day">14 Dec</span> |
|
<span>12:00 PM - 5:00 PM</span> |
|
</div> |
|
<h3>Beginner Korean cooking class with Ms. Lee</h3> |
|
<div class="location" title="Busan, Korea"> |
|
<span class="svg-wrapper" aria-hidden="true" focusable="false"> |
|
<svg viewBox="0 0 512 512"><path d="m407.579 87.677c-31.073-53.624-86.265-86.385-147.64-87.637-2.62-.054-5.257-.054-7.878 0-61.374 1.252-116.566 34.013-147.64 87.637-31.762 54.812-32.631 120.652-2.325 176.123l126.963 232.387c.057.103.114.206.173.308 5.586 9.709 15.593 15.505 26.77 15.505 11.176 0 21.183-5.797 26.768-15.505.059-.102.116-.205.173-.308l126.963-232.387c30.304-55.471 29.435-121.311-2.327-176.123zm-151.579 144.323c-39.701 0-72-32.299-72-72s32.299-72 72-72 72 32.299 72 72-32.298 72-72 72z"></path></svg> |
|
</span> |
|
<span>Busan, Korea</span> |
|
</div> |
|
</div> |
|
</div> |
|
|
|
<div class="grid__child"> |
|
<img src="https://images.unsplash.com/photo-1488992783499-418eb1f62d08?ixlib=rb-1.2.1&auto=format&fit=crop&w=1153&q=80"> |
|
<div class="text"> |
|
<div class="timing"> |
|
<span class="ma-day">14 Dec</span> |
|
<span>12:00 PM - 5:00 PM</span> |
|
</div> |
|
<h3>Food Plating: Learn easy food presentation and plating techniques</h3> |
|
<div class="location"> |
|
<span class="svg-wrapper online" aria-hidden="true" focusable="false"> |
|
<svg viewBox="0 0 512 512"><path d="m407.579 87.677c-31.073-53.624-86.265-86.385-147.64-87.637-2.62-.054-5.257-.054-7.878 0-61.374 1.252-116.566 34.013-147.64 87.637-31.762 54.812-32.631 120.652-2.325 176.123l126.963 232.387c.057.103.114.206.173.308 5.586 9.709 15.593 15.505 26.77 15.505 11.176 0 21.183-5.797 26.768-15.505.059-.102.116-.205.173-.308l126.963-232.387c30.304-55.471 29.435-121.311-2.327-176.123zm-151.579 144.323c-39.701 0-72-32.299-72-72s32.299-72 72-72 72 32.299 72 72-32.298 72-72 72z"></path></svg> |
|
</span> |
|
<span>Venice</span> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
|
|
<!-- auto-fit --> |
|
<h2> auto-fit: Grid items expand to take up all the available space of it's parent.</h2> |
|
<p class="code">grid-template-columns: repeat(auto-fit, minmax(300px,1fr));</p> |
|
<div class="grid grid--fit"> |
|
<div class="grid__child"> |
|
<img src="https://mahina.b-cdn.net/media/6.jpg?width=400&auto_optimize=high" alt="Korean side dishes"> |
|
<div class="text"> |
|
<div class="timing"> |
|
<span class="ma-day">14 Dec</span> |
|
<span>12:00 PM - 5:00 PM</span> |
|
</div> |
|
<h3>Beginner Korean cooking class with Ms. Lee</h3> |
|
<div class="location" title="Busan, Korea"> |
|
<span class="svg-wrapper " aria-hidden="true" focusable="false"> |
|
<svg viewBox="0 0 512 512"><path d="m407.579 87.677c-31.073-53.624-86.265-86.385-147.64-87.637-2.62-.054-5.257-.054-7.878 0-61.374 1.252-116.566 34.013-147.64 87.637-31.762 54.812-32.631 120.652-2.325 176.123l126.963 232.387c.057.103.114.206.173.308 5.586 9.709 15.593 15.505 26.77 15.505 11.176 0 21.183-5.797 26.768-15.505.059-.102.116-.205.173-.308l126.963-232.387c30.304-55.471 29.435-121.311-2.327-176.123zm-151.579 144.323c-39.701 0-72-32.299-72-72s32.299-72 72-72 72 32.299 72 72-32.298 72-72 72z"></path></svg> |
|
</span> |
|
<span>Busan, Korea</span> |
|
</div> |
|
</div> |
|
</div> |
|
|
|
|
|
<div class="grid__child"> |
|
<img src="https://images.unsplash.com/photo-1488992783499-418eb1f62d08?ixlib=rb-1.2.1&auto=format&fit=crop&w=1153&q=80"> |
|
<div class="text"> |
|
<div class="timing"> |
|
<span class="ma-day">14 Dec</span> |
|
<span>12:00 PM - 5:00 PM</span> |
|
</div> |
|
<h3>Food Plating: Learn easy food presentation and plating techniques</h3> |
|
<div class="location"> |
|
<span class="svg-wrapper online" aria-hidden="true" focusable="false"> |
|
<svg viewBox="0 0 512 512"><path d="m407.579 87.677c-31.073-53.624-86.265-86.385-147.64-87.637-2.62-.054-5.257-.054-7.878 0-61.374 1.252-116.566 34.013-147.64 87.637-31.762 54.812-32.631 120.652-2.325 176.123l126.963 232.387c.057.103.114.206.173.308 5.586 9.709 15.593 15.505 26.77 15.505 11.176 0 21.183-5.797 26.768-15.505.059-.102.116-.205.173-.308l126.963-232.387c30.304-55.471 29.435-121.311-2.327-176.123zm-151.579 144.323c-39.701 0-72-32.299-72-72s32.299-72 72-72 72 32.299 72 72-32.298 72-72 72z"></path></svg> |
|
</span> |
|
<span>Venice</span> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
Demo or Fork: https://codepen.io/Stanssongs/pen/QWERzoN