I am wondering if it is possible to have a squared css grid-item that overstretches (for example) from grid-column 1 to grid-column 5. How can I make a square out of this grid item element?
HTML would be something like this:
<div class="wrap">
<div class="squared">
This blue element should be a square.<br/>
Same height as width.
</div>
</div>
And CSS:
.wrap{
max-width: 1100px;
margin: 0 auto;
position: relative;
display: grid;
grid-template-columns: 20% 20% 20% 20% 20%;
}
.squared{
background-color: blue;
grid-column-start: 2;
grid-column-end: 5;
}
I have prepared a JSFiddle: https://jsfiddle.net/b8utkf21/