I am building a simple calendar. I am wanting the months to wrap responsively on screen, and the parent container to keep the width and height of its children. For example, if t
Your code is almost perfect, just apply box-sizing:border-box;
to .cal
and .month
elements. because border width is excluded from width without using border-box
.
I think that's not possible with css, i could find a best possible solution for your answer in my following code
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
We can just make it a little better looking by centering all children, because the reserved space on first line couldn't be deducted from parent's width.