title: How to Override/Undo CSS Class Attributes for Twitter Bootstrap
body: <p>About a year ago, @Andres Ilich provided a beautifully elegant answer to centering the navigation bar in Bootstrap.  <a href="https://stackoverflow.com/questions/10568103/modify-twitter-bootstrap-navbar">An excerpt from the posted answer is below:</a></p>
  
  <pre><code>&lt;div class="navbar navbar-fixed-top center"&gt;
       &lt;div class="navbar-inner"&gt;
          ....
       &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And then you can target the .center class like so:</p>
  
  <pre><code>.center.navbar .nav,
  .center.navbar .nav &gt; li {
      float:none;
      display:inline-block;
      *display:inline; /* ie7 fix */
      *zoom:1; /* hasLayout ie7 trigger */
      vertical-align: top;
  }
  
  .center .navbar-inner {
      text-align:center;
  }
  </code></pre>
  
  <p>Since this affected the drop down menu as well, he added this:</p>
  
  <pre><code>.center .dropdown-menu {
      text-align: left;
  }
  </code></pre>
  
  <p>So that the drop down menus would behave normally.</p>
  
  <p>Now I am facing a similar issue.  The navigation bar is beautifully centered.  Dropdowns work great.  But, when you get into tablet and mobile viewports, the mobile menu also gets centered. Simply aligning the text to the left does not solve the issue since each unordered list item needs its own line.  </p>
  
  <p>I have been trying to figure out a way where I could simply add a class inside a media query that would undo this, but I haven't been able to find a solution.</p>
  
  <p>Refer to this jsFiddle to see what I am talking about: <a href="http://jsfiddle.net/persianturtle/rAYyk/2/" rel="nofollow noreferrer">http://jsfiddle.net/persianturtle/rAYyk/2/</a></p>
  
  <p><strong>My question:</strong>  Is there a simple way (&lt;50 lines of code) to undo the above code inside a media query so this navigation menu would be centered desktop view and displayed as normal on tablets and phones? </p>
  
  <p>If this cannot be done with pure CSS, can a step-by-step explanation of how a jQuery solution would work?  Since I have h5bp, I already have jQuery 1.9.0 linked in.  </p>