mrsmnr
August 16, 2018, 9:47pm
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 )
Give your navbar a fixed position with top and left props to 0 and give it a 100% width
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
1 Like