Rami Dev Posted on Jan 22, 2021 • Edited on Jan 22, 2021 How to easily center anything in CSS ? #html #css You can easily center anything, with this 3 lines of CSS code: Top comments (2) Subscribe Submit Preview Dismiss Collapse Expand Stephan Nijman Stephan Nijman Stephan Nijman Follow Hi I'm Stephan Nijman! WordPress, Php, Javascript, React and Css Developer/Enthusiast/Blogger/Youtuber. Location the Netherlands Work Full stack web developer Joined Apr 23, 2019 • Jan 24 '21 Dropdown menu Copy link Hide Or with two lines :p .center { display: grid; place-items: center; } Collapse Expand Rami Dev Rami Dev Rami Dev Follow Front End Web Developer Location Egypt Work Front-end Web Developer Joined Jan 20, 2021 • Jan 24 '21 Dropdown menu Copy link Hide Yeah Grid team 😉 Code of Conduct • Report abuse
Top comments (2)
Or with two lines :p
.center {
display: grid;
place-items: center;
}
Yeah Grid team 😉