Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

jason limmm
jason limmm
7,581 Points

grids won't work

.container{
    margin:0 auto;
    max-width:840px;
    display:grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows:repeat(4, 1fr);
    grid-gap:10px;
    grid-template-areas:
    "1 1 1 1"
    "2 2 4 5"
    "2 2 3 6"
    "7 7 8 8";

}
.item{
    text-align:center;
    background-color:#6488ea;
    border-radius: 20px;
    padding:4rem;
    font-size: 2rem;
    color:white;
}
#1{
    grid-area:1;
}
#2{
    grid-area:2;
}
#3{
    grid-area:3;
}
#4{
    grid-area:4;
}
#5{
    grid-area:5;
}
#6{
    grid-area:6;
}
#7{
    grid-area:7;
}
#8{
    grid-area:8;
}

my grids won't split out as i want it to be, i don't have an image or illustration of how i want it.

here is a gist of how i want it, 4x4: 1 1 1 1 2 2 4 5 2 2 3 6 7 7 8 8

1 Answer

Rohald van Merode
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Rohald van Merode
Treehouse Staff

Hey jason limmm 👋

Try using string values for your area names instead of numbers. Number values for the grid-area property are used for specifying gridlines, you'll want to give them a string value in order for using them in combination with grid-template-areas` After converting things to use letters instead of numbers your grid should start working as expected 😃

Hope this helps! 🧑‍💻