Rami Dev Posted on Jan 22, 2021 How to easily center anything in CSS ? #css #html You can easily center anything, with this 3 lines of CSS code: Top comments (2) Subscribe Personal Trusted User Create template Templates let you quickly answer FAQs or store snippets for re-use. 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 Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well Confirm For further actions, you may consider blocking this person and/or reporting abuse
Top comments (2)
Or with two lines :p
.center {
display: grid;
place-items: center;
}
Yeah Grid team 😉