CSS CSS Flexbox Layout Building a Layout with Flexbox Creating a Sticky Footer with Flexbox

Bartlomiej Pajak
Bartlomiej Pajak
5,058 Points

Is my fixed navigation is ok?

So as additional task I want to navigation be always on the top of the page during scrolling. I have some issue while writing it but finally I achieved that result:

Here is my workspace: https://w.trhou.se/3awhi63tv4

Here's the links how it looks: https://ibb.co/nMWjqW9 https://ibb.co/ZBHXjxw https://ibb.co/br3cXDs

I I was inspired knowlegde form earlier videos on this course and my question is: is this code ok or must to be done different?

Thanks in advance for your help!

1 Answer

Abdul Zainos
Abdul Zainos
4,938 Points

Hi Bartlomiej Pajak,

I think you did a great job. You accomplished what you set out to do. Is there a better way to do the same thing? Yes. :) I say that lovingly. You had all the components needed to create a sticky navigation: position, top, and width. You also added a nice amount of top padding on the body (I see a lot of people miss this).

I didn't notice a ton of bloated/redundant code after my review and my only recommendation would be to work on your organization and commenting. I was a little confused about why you chose to nest your "sticky" declarations under the flex stylesheet. Personally, I would have included that code under base.css. Nonetheless, I think I understood what you were trying to do. Keep at it.

Here's a good resource for you for more info on this topic: Click Here