-2
I want to know if there is a way to move an item within a column to another column using css grid. Follow example:
here I wanted to move this green div to the second column of the purple div using css grid tags.
<div class="container">
<header>header</header>
<nav>menu</nav>
<main>
<div></div>
</main>
<span>span</span>
<footer>footer<footer>
</div>
html, body {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
box-sizing: border-box;
}
header {
grid-area: headerr;
background-color: pink;
}
nav {
grid-area: navv;
background-color: blue;
}
span {
grid-area: spann;
background-color: yellow;
}
main {
grid-area: mainn;
background-color: red;
}
main > div {
width: 220px;
height: 52px;
background-color: green;
}
footer {
grid-area: footerr;
background-color: black;
}
.container {
height: 100%;
width: 100%;
display: grid;
grid-template-areas:
'headerr headerr headerr headerr headerr headerr'
'headerr headerr headerr headerr headerr headerr'
'navv navv navv navv navv navv'
'spann mainn mainn mainn mainn mainn'
'spann mainn mainn mainn mainn mainn'
'spann mainn mainn mainn mainn mainn'
'spann mainn mainn mainn mainn mainn'
'spann mainn mainn mainn mainn mainn'
'footerr footerr footerr footerr footerr footerr';
}