C
C
Cheizer2019-11-20 16:50:06
css
Cheizer, 2019-11-20 16:50:06

How to make a complex grid grid?

Friends, there is a topic that is not easy for me, to make a grid in which the internal elements have a border only between themselves, there should not be borders along the edges, and all this needs to be adaptive.
Here is the grid model
5dd5444a00449004854978.png
I did so far for child elements, but it doesn't work for responsiveness

.item:nth-child(3n){
  border-right:0px;
}
.item:nth-last-child(-n+3){
  border-bottom:0px;
}

Is there a way to implement such a network while being adaptive?
Here is the model
https://codepen.io/Cheizer/pen/qBBvEEV

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
profesor08, 2019-11-20
@profesor08

<div>
  <span></span>
  <span></span>
  <span></span>
  <span></span>
  <span></span>
  <span></span>
  <span></span>
  <span></span>
  <span></span>
</div>

div {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-gap: 2px;
  background: red;
}

span {
  background: white;
  height: 100px;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question