title: HTML/CSS: Center Align Tabs
body: <p>Problem: the html/css below displays the tabs fine but I would like to align them to the center. I have tried various ways but they still align to the left. How can I align the three tabs to the center and keep them inline-block? Any help is greatly appreciated, thank you.</p>
  
  <p>I also attached a picture for reference. <a href="https://i.stack.imgur.com/ytn7q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ytn7q.png" alt="enter image description here"></a></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>main {
    min-width: 320px;
    max-width: 1000px;
    padding: 50px;
    margin: 0 auto;
    background: #fff;
  }
  
  section {
    display: none;
    padding: 20px 0 0;
    border-top: 1px solid #ddd;
  }
  
  .tabs {
    display: none;
    width: 100%;
    margin: 0 auto;
  }
  
  label {
    display: inline-block;
    margin: 0 auto;
    padding: 15px 25px;
    text-align: center;
    color: #bbb;
  }
  
  label[for*='1']:before {
    content: ;
  }
  
  label[for*='2']:before {
    content: ;
  }
  
  label[for*='3']:before {
    content: ;
  }
  
  label:hover {
    color: #888;
    cursor: pointer;
  }
  
  .tabs:checked+label {
    color: #555;
    border-bottom: 2px solid orange;
  }
  
  #tab1:checked~#content1,
  #tab2:checked~#content2,
  #tab3:checked~#content3 {
    display: block;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;main&gt;
    &lt;input class="tabs" id="tab1" type="radio" name="tabs" checked&gt;
    &lt;label for="tab1"&gt;Tab 1&lt;/label&gt;
  
    &lt;input class="tabs" id="tab2" type="radio" name="tabs"&gt;
    &lt;label for="tab2"&gt;Tab 2&lt;/label&gt;
  
    &lt;input class="tabs" id="tab3" type="radio" name="tabs"&gt;
    &lt;label for="tab3"&gt;Tab 3&lt;/label&gt;
    &lt;section id="content1"&gt;
      &lt;img src="/images/autocode.jpeg" alt="Doctor Icon" class="key-modules- 
          innter-image" height="180" width="auto"&gt;
      &lt;h1 class="key-modules-inner-div-header"&gt;Tab 2&lt;/h1&gt;
      &lt;p class="key-modules-inner-div-paragraph"&gt;random text will go here
      &lt;/p&gt;
      &lt;a href="/align-providers"&gt;
        &lt;button type="button" name="button" class="learn-button"&gt;Learn 
           more&lt;/button&gt;
      &lt;/a&gt;
    &lt;/section&gt;
  
    &lt;section id="content2"&gt;
      &lt;img src="/images/autocode.jpeg" alt="Doctor Icon" class="key-modules- 
          innter-image" height="180" width="auto"&gt;
      &lt;h1 class="key-modules-inner-div-header"&gt;Tab 3&lt;/h1&gt;
      &lt;p class="key-modules-inner-div-paragraph"&gt;random text will go here
      &lt;/p&gt;
      &lt;a href="/align-providers"&gt;
        &lt;button type="button" name="button" class="learn-button"&gt;Learn 
           more&lt;/button&gt;
      &lt;/a&gt;
    &lt;/section&gt;
    &lt;section id="content3"&gt;
      &lt;img src="/images/autocode.jpeg" alt="Doctor Icon" class="key-modules- 
          innter-image" height="180" width="auto"&gt;
      &lt;h1 class="key-modules-inner-div-header"&gt;Tab 3&lt;/h1&gt;
      &lt;p class="key-modules-inner-div-paragraph"&gt;random text will go here
      &lt;/p&gt;
      &lt;a href="/align-providers"&gt;
        &lt;button type="button" name="button" class="learn-button"&gt;Learn 
           more&lt;/button&gt;
      &lt;/a&gt;
    &lt;/section&gt;
  &lt;/main&gt;</code></pre>
  </div>
  </div>
  </p>