How can I manually determine how many columns show up in my grid with these rules?
display: grid;
grid-column-gap: 1rem;
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
For example, in my project the container <div>
is 1463px
. This results in 5 columns, each child having a width of 279.8px
. Knowing my container width and the grid-template-columns
rule, how can I calculate number of columns?