Submitted over 2 years ago
Responsive QR code page using HTML and CSS.
@AbhishekBh72
Design comparison
SolutionDesign
Solution retrospective
I want help on the positioning of elements/div in webpage. How can I place a section or an element in the exact center of a webpage?
Community feedback
- @ManuGil22Posted over 2 years ago
Hey @AbhishekBh72
To position a element in the exact center of a page you can use this attributes on the body element:
- height: 100vh; //To make the height of the body 100 viewheight units
- display: flex; //To use flexbox
- justify-content: center; //To center elements horizontally
- align-items: center; //To make all items center in the page vertically
I hope I answered your question! Keep pushing and happy coding!
Marked as helpful1@AbhishekBh72Posted over 2 years ago@ManuGil22 Thankyou so much for your suggestions. I just implemented the changes suggested by you and it's working properly.
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord