title: Jquery CSS How To Use Margin: 0 auto
body: <p>I'm new to Jquery. I want to know how can we use margin: 0 auto; CSS code in jquery scripting. Could anyone please help me out? Here's the code:</p>
  
  <pre><code>&lt;style&gt;
  #fixed-bar {
      padding: 0;
      background-color: black;
      z-index: 100;
  }
  &lt;/style&gt;
  &lt;script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'&gt;&lt;/script&gt;
  
  &lt;script&gt;
  $(function () {
    $("#fixed-bar")
      .css({
          "position": "fixed",
          "width": "960px",
          "margin": "0 auto",
          "top": "0px",
  
  })
      .hide();
    $(window).scroll(function () {
      if ($(this).scrollTop() &gt; 400) {
        $('#fixed-bar').fadeIn(200);
      } else {
        $('#fixed-bar').fadeOut(200);
      }
    });
  });
  &lt;/script&gt;
  &lt;div id='fixed-bar'&gt;
    Hello
  &lt;/div&gt;
  </code></pre>
  
  <p>Actually I want to center the bar. How can I do this?</p>