I am learning CSS Grid right now and encounter a 'bug' in safari
html,
body {
width: 100%;
height: 100%;
color: white;
text-transform: uppercase;
text-align: center;
font-family: helvetica, arial;
}
.full-size img {
width: 100%;
}
article {
min-height: 100%;
display: grid;
grid-template-rows: auto 1fr auto;
grid-template-columns: 100%;
}
header {
background: deeppink;
padding: 1rem;
}
main {
background: whitesmoke;
color: #444;
padding: 1rem;
}
footer {
background: purple;
padding: 1rem;
}
* {
margin: 0 !important;
padding: 0 !important;
}
<article>
<header>
Page Header
</header>
<main>
<strong contenteditable>Hi, there's not much content, yet. You can write in here to expand the container.</strong>
<figure class="full-size">
<img src="http://www.book-a-flat.com/magazine/wp-content/uploads/2017/05/Paris-8-appartement-toit-terrasse-piscine.jpg">
</figure>
<p>some text stuff...</p>
</main>
<footer>
All rights reversed.
<br>
<small>I am always at the bottom of the page</small>
</footer>
</article>
This is how the result looks in Safari:
This is how the result looks in Chrome:
In order to make it work, I have added grid-template-columns: 100%;
to the grid element, but in this guide, by Mozila we have the following note:
Note:
auto
track sizes (and onlyauto
track sizes) can be stretched by thealign-content
andjustify-content
properties.
So is the fix grid-template-columns: 100%;
wrong, or is it a bug in Safari?