Bartlomiej Pajak5,060 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
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!
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