+ 2

css box model

If we use margin:auto; then equal margin will be applied only to the left and right of the element and not all the sides.

30th Nov 2018, 10:25 PM
harshit
harshit - avatar
2 Antworten
+ 2
box
22nd Oct 2021, 4:26 PM
M.Salem AL-najjar
0
I think what you want is to do both margin-left: auto; and margin-right: auto; along with a width percentage to center horizontally.
30th Nov 2018, 11:49 PM
Jose Ayala
Jose Ayala - avatar