title: CSS calc() Why is 100% = width of parent element and not the width of the actual element
body: <p>I'm trying to create a simple text slider using <code>calc()</code> in CSS, but it's not working.</p>
  
  <p>To show how it's supposed to work, I have added the right value additionally</p>
  
  <p>EDIT:<br>
  I've edited the Code and it should now contain no further errors but it still doesn't work.<br>
  The 100% in calc() seem to refer to the parent element.<br>
  Ho do i fix this ?</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>.box {
    width: 200px;
    height: 30px;
    line-height: 30px;
    font-family: arial;
    font-weight: bold;
    color: #FFF;
    background: #000;
    overflow: hidden;
    cursor: default;
    -moz-user-sselect: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }
  
  .text {
    white-space: nowrap;
    float: left;
    padding: 0 7px;
    box-sizing: border-box;
    transition: margin 0.5s linear;
    background: #404040;
  }
  
  .a:hover {
    transition: margin 2s linear;
    margin: 0 0 0 -90.25px;
  }
  
  .b:hover {
    transition: margin 2s linear;
    margin: 0 0 0 calc(200px - 100%);
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="box"&gt;
    &lt;div class="text a"&gt;Dieser Text ist zu groß für diese Box&lt;/div&gt;
  &lt;/div&gt;
  &lt;br&gt;
  &lt;div class="box"&gt;
    &lt;div class="text b"&gt;Dieser Text ist zu groß für diese Box&lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>