Design comparison
Solution retrospective
I would like to know if I can use vanilla css for these projects or should I start learning some frame works? My second question: How can I make the footer stick at the bottom because I tried position relative and bottom:0; but nothing worked. Advice is welcome.
Community feedback
- @harpreet-singh-147Posted 11 months ago
body{ min-height:100vh; display:flex; flex-direction:column; align-items:center; position: relative; }
footer { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); font-size: 11px; text-align: center; width: 100%; }
You need to position the footer relative to the body. On the body tag, there is position relative, and on the footer, there is position absolute. Bottom: 20px or whatever value you want will place it where you want it. left: 50%; transform: translateX(-50%); will position the footer in the center of the page. You can use vanilla CSS for anything you want to. Learn how to use vanilla css first, then you can use other tools such as tailwind css and the others.
Marked as helpful0
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