Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Css level 16 lesson 3

<!DOCTYPE html>
<html>
<head>
<title>CSS Grid Template</title>
<style>
.grid {
display: grid;
background-color: #d6d1f5;
padding: 20px;

}
.item {
background-color: #E7E4F8;
border: 1px solid black;
padding: 20px;
text-align: center;
}
</style>
</head>
<body>
<div class="grid">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
<div class="item">4</div>
<div class="item">5</div>
<div class="item">6</div>
<div class="item">7</div>
<div class="item">8</div>
<div class="item">9</div>
</div>
</body>
</html>
by

1 Answer

sam5epi0l
I think you need to fix grid element css. Here is how:


<!DOCTYPE html>
<html>
<head>
<title>CSS Grid Template</title>
<style>
.grid {
display: grid;
background-color: #D6D1F5;
padding: 20px;
grid-template-columns: [start] 50px [line2] auto [line3] 25% [end];
grid-template-rows: 150px 15% auto;
}
.item {
background-color: #E7E4F8;
border: 1px solid black;
padding: 20px;
text-align: center;
}
</style>
</head>
<body>
<div class="grid">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
<div class="item">4</div>
<div class="item">5</div>
<div class="item">6</div>
<div class="item">7</div>
<div class="item">8</div>
<div class="item">9</div>
</div>
</body>
</html>

Login / Signup to Answer the Question.