Use margins: auto we can position aelement horizontally by automatically adjusting the left and right margins.
.deepak { width: 50%; margin: 0 auto;}
.deepak {
width: 50%;
margin: 0 auto;
}
Using flexboxYou can use flexbox to center a horizontally within its containing element.
.deepak { display: flex; justify-content: center;}.deepak div { width: 50%;}
display: flex;
justify-content: center;
.deepak div {
Use margin:auto
margin:auto
Use below css for div.margin:0px auto;
Adding the below CSS will help you attain the same:display: flex;justify-content: center;
display: flex;justify-content: center;