title: Cant center a div in CSS (BANNER FIXED AT BOTTOM)
body: <p>Im developing a website and I want to put a banner fixed at the bottom of the page with its own close button in order to people can close the ads.</p>
  
  <p>I achieve the whole apparence of the div with css but its impossible to me center it, I try text-align: center, margin-left: auto, margin-right: auto, margin: 0 auto, fixing width to 300px and many other options and nothing works!!</p>
  
  <p>This is my code CSS of the banner:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#fragment {
    font-size: 12px;
    font-family: tahoma;
    /* border: 1px solid #ccc;*/
    color: #555;
    display: block;
    /* padding: 10px; */
    box-sizing: border-box;
    text-decoration: none;
    min-height: 50px;
    width: 300px;
    overflow: hidden;
    position: fixed;
    bottom: 0;
    margin-left: auto;
    margin-right: auto;
  }
  #fragment:hover {
    box-shadow: 2px 2px 5px rgba(0, 0, 0, .2);
  }
  #close {
    float: right;
    display: inline-block;
    padding: 2px 5px;
    background: #ccc;
  }
  #close:hover {
    float: right;
    display: inline-block;
    padding: 2px 5px;
    background: #ccc;
    color: #fff;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="fragment"&gt;
    &lt;span id="close" onclick="myFunction()"&gt;x&lt;/span&gt; 
    &lt;!--THE X ICON TO CLOSE THE BANNER --&gt;
    &lt;!-- the script code of the ads provided by some company --&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>