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

Room homepage - HTML / CSS / JS

BT738844 600

@BT453567

Desktop design screenshot for the Room homepage coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
3intermediate
View challenge

Design comparison


SolutionDesign

Solution retrospective


What are you most proud of, and what would you do differently next time?

The image carousel is what I am most proud of.

What challenges did you encounter, and how did you overcome them?

I had to give some thought on how the image carousel would work.

I have ensured the image displayed is from the picture/img element as I find it easier to control the size of the div's to ensure they are displayed correctly and the grid is shaped correctly.

When the user presses the left or right button, the next image is dynamically placed next to the current image and then moves across. This ensures that windows resizes are easily managed for the images.

What specific areas of your project would you like help with?

Any feedback would be welcomed.

Community feedback

@krushnasinnarkar

Posted

Hi @BT453567,

Congratulations on successfully completing the challenge!

Your solution looks nice, though there are a couple of things you can improve which I hope will be helpful!

1. Using height: 100vh Instead of height: 100%

Instead of using height: 100%; for the body, use height: 100vh;.

Reason: 100vh refers to 100% of the viewport height, ensuring that the body always fills the full height of the browser window, even if the content is less than the viewport height. This prevents issues where the body might not fully stretch to the bottom of the viewport.

body {
    height: 100vh;
}

2. Preventing Stretching on Large Screens

Your website keeps stretching as we increase the screen size because you use width: 100% in .grid-container. You can solve this issue by using a max-width of 1440px instead of width: 100%.

After doing this, you might need to center the .grid-container horizontally, as it will get aligned to the left by default. You can center it by making the body element a flex container and using justify-content: center.

body {
    display: flex;
    justify-content: center;
}

.grid-container {
    max-width: 1440px;
    width: 100%;
}

3. Making the Header (nav) Sticky

One more improvement you can do is make the header (nav) sticky so that users can always see the header when they scroll.

header {
    position: sticky;
    top: 0;
    z-index: 1000; /* Ensure it stays above other content */
}

Summary

  1. Use height: 100vh for the body to ensure it fills the viewport height.
  2. Apply max-width: 1440px to .grid-container and center it using flexbox on the body.
  3. Make the header sticky for better navigation visibility.

I hope you find this helpful, and I would greatly appreciate it if you could mark my comment as helpful if it was.

Feel free to reach out if you have more questions or need further assistance.

Happy coding!

Marked as helpful

1

BT738844 600

@BT453567

Posted

Hello @krushnasinnarkar

Thanks for those recommendations

I like the animations you have used on your solutions

0

@krushnasinnarkar

Posted

Thank you, @BT453567, for appreciating my animation! You can check out my repository code to see how I implemented it.

Feel free to reach out if you have any more questions or need further assistance.

Happy coding!

0

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