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 Framework Basics Prototyping with Bootstrap Building a Fixed Navbar

Fábio Tavares da Costa
Fábio Tavares da Costa
11,985 Points

dropdown =< 768 bug

The dropdown menu for <= 768 xs, initially, is above the fixed bar. To visualize, home and Ribbit are at same level.

It partially fixes the bug:

/* Navbar collapse */

@media (max-width: 768px) {
    .navbar-collapse {
    position: relative;
    margin-top: 60px;
    overflow-y: visible;
    transition: color .01s ease-in-out .01s
    }
} 

When I click the hamburger icon to contract back the expanded drop down list the the effect is truncated.

Any idea?

1 Answer

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

Try adding a semi colon to the transition declaration in your CSS. :-)

Fábio Tavares da Costa
Fábio Tavares da Costa
11,985 Points

It will not have any effect Jonathan. Semi colons in CSS exist to divide multiple properties. A declaration with a single property does not require any semi colon.

:target {
  color: blue /* optional semi colon | 100% correct */
}

:target {
  background: orange; /* divisor */
  color: blue /* optional semi colon | 100% correct */
}

:target {
  display: block; /* divisor */  
  background: orange /* error */
  color: blue;
}

The last semi colon is added out of habit or just in case you return later and add a new property as in the last example.

The intention is what matters. Thanks!