1

I'm using grid in my nav element that contains 7 nested elements. I want the first one to be at least 2x larger than the others. I tried to use this:

grid-template-columns: 2fr repeat(auto-fit, minmax(100px, 1fr));

But it doesn't work, in the console it shows that is invalid property value, why? How can I do this in another way?

Paulie_D
  • 107,962
  • 13
  • 142
  • 161
bartekw2213
  • 81
  • 1
  • 7

1 Answers1

2

Something like that ?

Also, maybe this could help : CSS Grid with variable number of “auto” rows, but one row should take “1fr”

.container{
display:grid;
grid-template-columns: 2fr repeat(6, minmax(auto,1fr));
}

.el:first-child{
background-color:red;
}

.el{
border:solid 1px black;
}
<div class="container">
  <div class="el">Element</div>
  <div class="el">Element</div>
  <div class="el">Element</div>
  <div class="el">Element</div>
  <div class="el">Element</div>
  <div class="el">Element</div>
  <div class="el">Element</div>
</div>
Manon
  • 329
  • 1
  • 8