Design comparison
Solution retrospective
Hi there!
This was a fun project. It took me one to two hours to make.
I faced some difficulties on the way, So I will mention them here, kindly share your feedback and suggestions.
-
I struggled to centre the container without the help of flexbox, I used absolute positioning but it didn't help. Kindly share How can I centre it.
-
I tried to indent the text within list elements but couldn't find a solution. I would greatly appreciate it if you could provide some insight.
That's all. I faced some other difficulties but I googled it and found the answers.
Thank You!
I had fun ๐.
Community feedback
- @Bishalsnghd07Posted 9 months ago
Hi, Rahul๐
Congrats for completing this challenge ๐ and you did great job ๐
No, using absolute will be wrong approach, I review your code, the mistake you did is your necessary elements which are should be used in body(parent) div, but you used in child div. To center the container you should be used this property in parent container =>
body{ display: flex; justify-content: center; align-items: center; flex-direction: column; margin: 4rem; **min-height: 100vh**;(add this to maintain your screen actual size) }
Hope, this small tip will help you to center your container.
If, still have issue then feel free to ping me here โบ๏ธ
Happy Codingโค๏ธ
Marked as helpful2 - @Vincent-BoutonPosted 9 months ago
Hello Rahul! ๐
Like Bishal said, Absolute isn't the best solution altough you can center your container with the
position:absolute
if you really want to.body:{ position:relative; /* This is base style for body and don't need to by write */ } .container{ position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
For your text indent on some list points :
<ul>
and<ol>
have really annoying style. The best is sometimes to remove all base style from it and make your own. In this case I would have done it this way and hard write the numbers of the list. ๐งThis is one way (if not the only) to center a container using absolute and relative position. ๐
Your solution is very good! Keep the good work. ๐ช
Marked as helpful1
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