Skip to content Skip to sidebar Skip to footer

Collapsed Nav Button Not Expanding In Bootstrap

So I'm trying to make a nice header at the top of my Django site that collapses whenever someone has a small window or they're on mobile. The nav menu collapses fine and looks grea

Solution 1:

Your code seems working fine, most probably the problem has to be with your jquery and/or bootstrap.js CDN's. Insert the correct CDN's.

<head><title>Bootstrap Example</title><metacharset="utf-8"><metaname="viewport"content="width=device-width, initial-scale=1"><linkrel="stylesheet"href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"><scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script><scriptsrc="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script></head><navclass="navbar navbar-default navbar-fixed-top"><divclass="container-fluid"><!-- Brand and toggle get grouped for better mobile display --><divclass="navbar-header"><buttontype="button"class="navbar-toggle"data-toggle="collapse"data-target=".navbar-collapse"><spanclass="sr-only">Toggle navigation</span><spanclass="icon-bar"></span><spanclass="icon-bar"></span><spanclass="icon-bar"></span></button><aclass="navbar-brand"href="/">My Name</a></div><!-- Collect the nav links, forms, and other content for toggling --><navclass="collapse navbar-collapse"role="navigation"><ulclass="nav navbar-nav"><li><ahref='/'>Home</a></li><li><ahref='/blog/'>Blog</a></li><li><ahref='/projects/'>Projects</a></li><li><ahref='/resume/'>Resume</a></li><li><ahref='/contact/'>Contact</a></li></ul></nav><!-- /.navbar-collapse --></div><!-- /.container-fluid --></nav>

Solution 2:

For others who will get here from a web search:

I had this same problem - not being able to expand a navbar - but all of my code was fine.

My problem was that I had a network-level ad blocker that was blocking some of my CDN'ed scripts.

Facepalm.

@AVI's answer helped me reach this conclusion, check your CDN

Post a Comment for "Collapsed Nav Button Not Expanding In Bootstrap"