I have a parent div that contains a another div with a grid layout. The grid layout will have 1 row and arbitrary many columns.
How to specify that the width of the columns must be equal to 100% of the parent width?
I have a parent div that contains a another div with a grid layout. The grid layout will have 1 row and arbitrary many columns.
How to specify that the width of the columns must be equal to 100% of the parent width?
2
Answers
Use
grid-auto-flow: column;grid-auto-columns: 100%;
When you define the classes for your divs in your CSS file, if you specify a width that width will be, by default, in relation to the parent container.
If you want to make sure, because some browsers may have different defaults, you can specify
position: relative;
in your definition.example