How to Center a div Vertically and Horizontally

We can center a div or any element vertically and horizontally by using some CSS properties. You can see below, we have used some CSS properties for aligning the child div inside the parent div.

HTML

CSS

JS

Leave a Reply

Your email address will not be published. Required fields are marked *