Portfolio Challenge: navbar trouble

Portfolio Challenge: navbar trouble
0

#1

Hi! I am struck at the moment at trying to fix the navbar user story in the portfolio challenge. I did quite a bit of googling and tweaking and cannot seem to find it.

Here is my CodePen: https://codepen.io/mrsmnr/pen/KBjGoG

The script error is not very helpfull (to me) :

Script error. (:0)
Error: Script error. (:0)
at uncaughtException.i.onerror (https://cdnjs.cloudflare.com/ajax/libs/mocha/5.2.0/mocha.min.js:1:865)


#2

Give your navbar a fixed position with top and left props to 0 and give it a 100% width


#3

It doesn’t seem to work…


#4

There’s a class named .navbar which CSS rules are in conflict with the rules you set for your nav tag.

<nav id="navbar" class="navbar navbar-fixed-top">

Since you already set an id to this tag, you can just rename the nav rule to #navbar

#navbar{
  position: fixed;
  top:0;
  left:0;
  width:100%;
}

This link explains what is going on with your code: https://marksheet.io/css-priority.html