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

JavaScript Using jQuery Plugins Add a Sticky Navigation Bar The Plugin Challenge Solution

We set background to white (#fff) but why this is still transparent?

We set background color to white (#fff) but why this is still partially transparent? How to make it solid white so we couldn't see stuff behind it while scrolling the page? Here is a link to my snapshot: https://w.trhou.se/0uz4bk931n. Thanks!

Steven Parker
Steven Parker
229,695 Points

To enable a complete and accurate analysis, make a snapshot of your workspace and post the link to it here.

Sorry, I thought the same behaviour is in the video with the challenge solution, but now I see that Dave's solution is working fine. Here is a link to my snapshot: https://w.trhou.se/0uz4bk931n. Thanks!

2 Answers

Neil McPartlin
Neil McPartlin
14,662 Points

I know this answer is too late for you, but it may help others who encounter this. If you look at the main.css file at line 232, here there is a style definition that involves the <h5> tag and it conflicts with your definition at line 349.

Line 232

 /*Sticky*/
.is-sticky h5 {
  width: 100%;
  position: fixed;
  top: 0px;
  background: #fff;
  padding: 12px 0;
  margin: 0;
  opacity: 0.95;
}

All I did was change the opacity to 1 and your code now works correctly.

Credit to Iain Simmons who alluded to this in an earlier post https://teamtreehouse.com/community/i-dont-understand-the-last-part.

Joseph Wasden
Joseph Wasden
20,406 Points

We would need to see your code to provide an accurate assessment. try and share your code directly from the code challenge. Good luck!

Steven Parker
Steven Parker
229,695 Points

This should probably be a comment, not an answer.

Also, he seems to be working on some project code that's not part of a challenge, that's why I suggested the snapshot would be the best way to share the code.

Tagging: Joseph Wasden