Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS

Alexander Dolgan
Alexander Dolgan
5,208 Points

Sticky header in Hero section

Hi to all! I can't solve a problem with my first project. If someone give me hint, it will be great. So, I have header section with

  • h1 tag with company name in the center of header div - position: absolute
  • Hero slider (bootstrap carousel), 70% window height. I need to add affix(position:fixed) for this element when user scroll page down. Problem is how better organize code for solve this task? Now I use this code: http://codepen.io/AlexanderDolgan/pen/bEjwRP Thanks for any help!