title: Display Text and Custom Toggle in same line
body: <p>I'm trying to develop a custom toggle button and attache a text before it. I want the text and toggle to be in the same line. But, the text is coming in one line and the toggle in other.</p>
  
  <p>The working code: <a href="https://jsfiddle.net/nvarun123/x6v1nevw/1/" rel="nofollow">https://jsfiddle.net/nvarun123/x6v1nevw/1/</a></p>
  
  <p>When i add the style <code>display:inline-block;</code> then the shape of the toggle circle is getting disturbed. I'm trying to develop this in Angular2 as a component.
  The woking code in Angular2:<a href="http://plnkr.co/edit/4ZnrnJbSyFAp5c6Z0V7T?p=preview" rel="nofollow">http://plnkr.co/edit/4ZnrnJbSyFAp5c6Z0V7T?p=preview</a></p>
  
  <p>HTML code:</p>
  
  <pre><code>   &lt;div style="display:inline;"&gt;  
      Toggle1:
      &lt;div class="onoffswitch" style="margin-bottom:5px;"&gt;
          &lt;input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch" checked &gt;
          &lt;label class="onoffswitch-label" for="myonoffswitch"&gt;
              &lt;span class="onoffswitch-inner"&gt;&lt;/span&gt;
              &lt;span class="onoffswitch-switch"&gt;&lt;/span&gt;
          &lt;/label&gt;
      &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div style="display:inline;"&gt;
      Toggle2:
      &lt;div class="onoffswitch" style="margin-bottom:5px;"&gt;
      &lt;input type="checkbox" name="onoffswitch1" class="onoffswitch-checkbox" id="myonoffswitch1" &gt;
          &lt;label class="onoffswitch-label" for="myonoffswitch1"&gt;
              &lt;span class="onoffswitch-inner"&gt;&lt;/span&gt;
              &lt;span class="onoffswitch-switch"&gt;&lt;/span&gt;
          &lt;/label&gt;
      &lt;/div&gt;
      &lt;/div&gt;  
  </code></pre>
  
  <p>CSS code:</p>
  
  <pre><code>.onoffswitch {
      position: relative; width: 50px;
      -webkit-user-select:none; -moz-user-select:none; -ms-user-select: none;
  }
  .onoffswitch-checkbox {
      display: none;
  }
  .onoffswitch-label {
      display: block; overflow: hidden; cursor: pointer;
      border-radius: 10px;
  }
  .onoffswitch-inner {
      display: block; width: 200%; margin-left: -100%;
      transition: margin 0.3s ease-in 0s;
  }
  .onoffswitch-inner:before, .onoffswitch-inner:after {
      display: block; float: left; width: 50%; height: 22px; padding: 0; line-height: 22px;
      font-size: 10px; color: white; font-family: sans-serif; font-weight: bold;
      box-sizing: border-box;
  }
  .onoffswitch-inner:before {
      content: "";//ON
      padding-left: 8px;
      background-color: lightgreen; 
      color: pink;
  }
  .onoffswitch-inner:after {
      content: "";//OFF
      padding-right: 6px;
      background-color: red; 
      color: #F9FAFB;
      text-align: right;
  }
  .onoffswitch-switch {
      display: block; width: 20px; margin: 0px;
      background: #F9FAFB;
      position: absolute; top: 0; bottom: 0;
      right: 30px;
       border-radius: 20px;
      transition: all 0.3s ease-in 0s; 
      box-shadow: 0.276px 0.961px 2px 0px rgba(0, 0, 0, 0.1);
  }
  .onoffswitch-checkbox:checked  + .onoffswitch-label .onoffswitch-inner {
      margin-left: 0;
  
  }
  .onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-switch {
      right: 0px; 
  
  }
  </code></pre>