First of all you should add your CSS after the bootstrap.css
.
Here is what you will need for proper display:
.hidden-desktop {
display: none !important;
}
.visible-desktop {
display: inherit !important;
}
@media (max-width: 979px){
.nav-collapse .nav>li>a, .nav-collapse .dropdown-menu a {
padding: 9px 15px;
font-weight: bold;
color: #777777;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
}
@media (max-width: 979px){
.navbar .brand {
padding:10px;
margin: 0 0 0 -5px;
}
}
@media (max-width: 767px){
.hidden-desktop {
display: inherit !important;
}
}
EDIT:
To hide the first with CSS you would need this one (but it's better to reuse the .visible-desktop
class)
Here is the CSS to hide the first-child
@media (max-width: 768px){
#twitterbootstrap .navbar .nav > li:first-child{
display: none ;
}
}
Here is a fiddle
EDIT 2
The .hidden-desktop
element should be placed before .navbar-collapse
<div>
.
Furthermore I changed the CSS to this:
@media (max-width: 767px){
.hidden-desktop {
display: inherit !important;
padding: 15px;
margin: 0 0 0 -5px;
}
}
+ I've forked & updated your fiddle -> UpdatedFiddle