What is Nostr?
Guilherme Dea /
npub1rgw…4s0k
2024-06-28 01:06:55

Guilherme Dea on Nostr: I was coding a javascript function to create a grid with equal sides. When ...

I was coding a javascript function to create a grid with equal sides. When calculating height and width, I calculated 100 / number of columns/rows. This made flexbox act weird, pushing the last square of the row to the next row, leaving a solitary square on the last row. I fixed it by changing width to 95 / number. But it left gaps between the rows...which I fixed by reverting the height calc to 100 / number.

Now, I want to understand why the hell I had to do all this and how it worked???
Author Public Key
npub1rgwu5mhnhdtscpkewukem0whht003jv8ysedrvhexj88l2s7tqwqdq4s0k