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

Responsive homepage using html, css and vanilla js only

#vite

@vovlasl

Desktop design screenshot for the News homepage coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


Hi everybody. I have some problems with this project and I'd like if someone could point out what i did wrong. So... problem number:

  1. The container below the navigation is off center and Ι don't know why or how to fix it.

  2. When I open the menu (on a small window size), I would like it to not be able to scroll.

  3. Is there a better way to put the "read more" button at the bottom of its container.

If you see something else that's wrong please tell me, it will help me a lot.

Community feedback

P
ApplePieGiraffe 30,545

@ApplePieGiraffe

Posted

Hello there, Loukas Vovlas! 👋

Good job on this challenge! 👏

The reason the main content in your site appears slightly off center is because there is some extra gap being added to the right side of the grid of div.two-columns. To get rid of that, set grid-column: 1 / span 2 on div.three-columns (instead of grid-column: span 3). Also, be sure remove the width property from div.small-box so that it can fill up all of the space in its section of the grid container

To prevent the page from scrolling when the mobile menu is open, you'll need to add overflow: hidden to the body when the menu is toggled. You can do that with a little JS (and remember to remove that style when the menu is closed so that users can scroll again)

You could make the attribution always stick to the bottom of the screen with absolute positioning (but it may overlap the rest of the content at times), so instead you could turn the body into a flex container (make it flex-direction: column) and add margin-bottom: auto to main. That will push the attribution to the bottom of the body if there is ever any extra space

Hope you find these suggestions helpful. 😊

Keep coding (and happy coding, too)! 😁

Marked as helpful

0

@vovlasl

Posted

@ApplePieGiraffe Thank you so much. Now it's working properly thanks to you :) I Didn't do the nav overflow yet but i'll do it tomorrow for sure. Thanks again :)

1
P
ApplePieGiraffe 30,545

@ApplePieGiraffe

Posted

@vovlasl

Glad to help! 👍

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