Interactive online courses HTML Academy
2026-03-09 14:12 Diff

In order to center one block inside another block, we usually use the classic combination of methods of positioning and setting relative coordinates and negative margins.

This device works well when the centered block has fixed dimensions, but if its dimensions are changed, then there can be problems.

You can solve this problem using transforms and center the blocks with variable sizes. You do this with translate.