0
.navigation {
padding: 0;
margin: 0;
background: #333;
position: fixed;
top: 0;
z-index: 999;
width: 100%;

li {
    display: inline-block;
    padding: 5px 10px;

    a { 
        color: #e1e1e1;
        text-decoration: none;

        &:hover{
            color: lighten(#e1e1e1, 20%);

        }
    }
}

i am trying to create a menu bar which is in horizontal format. i have already tried using display: inline-block but still i am having problem with it. I even tried using display: inline but it seems its not solving. can anyone help me to solve this.

2
  • Provide your code with html or jsfiddle or telepathic gift, please Commented Apr 15, 2014 at 15:32
  • this is the link to the jsfiddle jsfiddle.net/vc2eH Commented Apr 15, 2014 at 15:38

1 Answer 1

1

are you writing this in scss? I'm guessing your nesting is off because it works fine in regular css:

.navigation {
  padding: 0;
  margin: 0;
  background: #333;
  position: fixed;
  top: 0;
  z-index: 999;
  width: 100%;
}

li {
  display: inline-block;
  padding: 5px 10px;
}

a { 
  color: #FFF;
  text-decoration: none;
}

a:hover{
   color: lighten(#e1e1e1, 20%);
}

FIDDLE

looks like you're missing the last } that would close .navigation. Try that UPDATE: thats the answer: NEW FIDDLE

Sign up to request clarification or add additional context in comments.

3 Comments

It's true that the OP missed the } closing the declaration for .navigation. His fiddle does also not have the language (which can be chosen on the left sidebar) set to SCSS (the default is CSS).
didnt even realize you could switch to scss in jsfiddle, thanks for the tip
@user3536613 no problem. Just mark this as correct for future use

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.