CSS: How to center a div / html element block (display:block)

text-align: center ;



will center the contents within it.



However centering outside of the block occurs as a default by setting a width and the horizontal- margins to auto:



width: 500px ;

margin-left: auto ;

margin-right: auto ;



LihatTutupKomentar