Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Recipe Page

@rahulkumar215

Desktop design screenshot for the Recipe page coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

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.

  1. 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.

  2. 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

@Bishalsnghd07

Posted

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 helpful

2
Vincent 190

@Vincent-Bouton

Posted

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 helpful

1

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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