I have being learning CSS and practicing the things I have learnt the main thing that I am slightly confused about is centring elements or div’s containing elements:
So for a div to be a parent we would set the div position to relative;
and the elements inside the div would be absolute;
But what’s the best way to center a div and center the elements inside of it, is it best to use margins or just use left:100px for example.
Setting elements to position: absolute should be the last option of choice because it is tricky to make that responsive. There are several options to center elements: