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 Modular CSS with Sass Sass and BEM Using BEM in our Project

Eric Nevitt
Eric Nevitt
4,914 Points

Menu isn't inline-block with Modular CSS

I'm having trouble getting the menu to go to a incline-block in Modular CSS. I have compared the code to the code on the tutorial to make sure everything is correct, but it's still not acting like it should.

Here is my code:

.nav {
 margin-top: em(20px);
 margin-bottom: em(30px);
 &__item {
  display: inline-block;
  margin: 0 em(12px);
  a {
   font-size: em(18px);
   font-weight: $font-weight--light;
   color: palette(grey);
   display: block;
   padding: em(8px, 18px);
   border-bottom: 1px solid transparent;
  }
  &--current a {
   color: palette(black);
   border-color: $color-primary;
  }
 }
}
<ul class="nav">
  <li class="nav__item"><a href="#">Typography</a></li>
  <li class="nav__item"><a href="#">Buttons</a></li>
  <li class="nav__item"><a href="#">Forms</a></li>
  <li class="nav__item"><a href="#">Images</a></li>
  <li class="nav__item"><a href="#">Grid</a></li>
  <li class="nav__item nav__item--current"><a href="#">Navigation</a></li>
</ul> 

2 Answers

Eric Nevitt
Eric Nevitt
4,914 Points

It worked after I tried it again.

Guil Hernandez
STAFF
Guil Hernandez
Treehouse Teacher

Hi Eric Nevitt,

Your code seems fine. Did you compile your code to CSS, or use the sass --watch command in the console? If so, please post a screenshot of what it looks like in the browser preview. Thanks!