freeCodeCamp Challenge Guide: Center an Element Horizontally Using the margin Property

Center an Element Horizontally Using the margin Property


Solutions

Solution 1 (Click to Show/Hide)
<style>
  div {
    background-color: blue;
    height: 100px;
    width: 100px;
    margin: auto;
  }
</style>
<div></div>
2 Likes