creating an (ultimately) three tier tree view structure sports > teams> players progress: https://jsfiddle.net/zigzag/kusuz233/1/
body {
margin: 10px;
}
.firstLevel {
display: grid;
grid-template-columns: 200px 200px 200px;
grid-template-rows: 200px;
background-color: #fff;
color: #444;
margin-bottom: 20px;
}
.firstLevel > .box{
background-color: red;
}
.secondLevel > .box{
background-color: gray;
}
.secondLevel {
display: grid;
grid-template-columns: 200px 200px 200px;
grid-template-rows: 200px 200px;
grid-gap: 10px;
background-color: #fff;
color: #444;
}
.box {
color: #fff;
padding: 20px;
font-size: 150%;
}
<div class="firstLevel">
<div class="box">Sports</div>
</div>
<div class="secondLevel">
<div class="box a">NBA</div>
<div class="box b">NFL</div>
<div class="box c">NHL</div>
<div class="box d">IPL</div>
<div class="box e">MLB</div>
<div class="box f">MLS</div>
</div>
How do I get the sports box to be centered with same width as the others?
Also, I started out doing one grid container but then had issue with the top node so separated in two grid containers. perhaps this can be accomplished within just one container? In my case the text and description here will be dynamic and so will the number of objects so just planning for that... Appreciate any input.