To Horizontaly centered the <div> Element :
- We can use the property of margin set to auto i.e margin:auto;.
- The <div> Element takes up its specified width and divide equally the remaining space by the left and right margins.
Supported Browsers: The browser supported by margin:auto property are listed below:
- Apple Safari
- Google Chrome
- Internet Explorer
- How to make an image center-aligned (vertically & horizontally) inside a bigger div using CSS?
- HTML | center Tag
- How to vertically center text with CSS?
- How to make elements float to center?
- Graph measurements: length, distance, diameter, eccentricity, radius, center
- Bootstrap 4 | Input Groups
- PHP | get_headers() Function
- Bootstrap 4 | Custom Forms
- PHP | ftp_get_option() function
- PHP | ftp_chdir() function
- Bootstrap 4 | Cards
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.