For this example, it is enough to handle this line:
.flex-item { ... ; height: auto; }
Modify its value by:
.flex-item { ... ; height: 50px; }
This modification will not change anything at all. The height will still be calculated automatically.
To make all square cells read just below:
Here is one possible way to make all the cells square using Flexbox.
.flex-item { ... ; height: auto; width: auto; min-width: 50px; /* minimum width of 50px; adapt to your needs */ }
The above is the detailed content of Why Doesn't Setting a Fixed Height on a Flex Item Affect Its Size?. For more information, please follow other related articles on the PHP Chinese website!