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
Angelina Bethoney
117 PointsFixed Icon Jumping While Scrolling - Mobile
Hi!
I'm creating a responsive site. When the window is 750px or less, my nav bar "disappears" and a hamburger icon replaces it. It has a fixed position. It works well until a user scrolls, then the icon kind of jumps up or down depending on the scroll, and then settles back into place. Any suggestions on how to prevent this jumping effect?
Here's my css:
.hamburger { position:fixed; top:65px; margin:0 auto; left:48%; display:block; }
3 Answers
Owen Swift
5,744 PointsTry adding some padding. If that doesnt work you could use Stack Overflow. They've always got the answer.
Angelina Bethoney
117 Pointshow will padding prevent it from jumping? i've already checked SO
Owen Swift
5,744 PointsI dont know really but alot of the time if something goes wrong with my code, adding some padding fixes it i dont know why.