Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Jiten Mehta
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Jiten Mehta
Front End Web Development Techdegree Graduate 21,209 Points

Sticky Header on Scroll

Hi guys. Got a question regarding sticky headers.

So i seen this example elsewhere, link =https://www.balbooa.com/showcase-template/gridbox/sticky-header-on-scroll-with-gridbox#download h The navigation bar start at the bottom, and then sticks to the top once the navigation bar reaches the top of the viewport.

Any idea on how I can achieve this?

Thanks, Jiten.

4 Answers

From what I can make out of your question is a sticky header that sticks to the top after scrolling down a bit. Which requires CSS and some JavaScript. I have the right video for you from treehouse which teaches you how to do just that:

https://teamtreehouse.com/community/forum-tip-create-a-sticky-navigation-with-css-and-jquery-2

From what I saw, the navigation does not start from the bottom, however, you can achoeve that with JavaScript. But a header to start sticky at top can be achieved with CSS using display property on the header.

Header{

display: fixed;

}

I hope that has helped.

Jiten Mehta
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Jiten Mehta
Front End Web Development Techdegree Graduate 21,209 Points

Hi Furkan. Apologies, I pasted in the link with the download section id. So it scroll half way down the page.

This link should do it.

https://www.balbooa.com/showcase-template/gridbox/sticky-header-on-scroll-with-gridbox#home

And yes I think I will need Javascript.

Would you know of any courses on teamtreehouse that will teach me to create this effect?

Thanks, Jiten.

You are very welcome. Happy coding!