title: CSS: Responsive Layout don't behave like it (mathematically) should
body: <p>I'm doing a three columns layout which shall behave responsive.</p>
  
  <p>When the screen-width becomes smaller then 1025px then the three columns, which are ordered beside each other on large screens, become stacked upon each other.</p>
  
  <p>The unordered list which is content of the left-column shall become ordered horizontally (instead of vertically). </p>
  
  <p>The parent div has now a width of 800px. No margins, borders, paddings.
  The ul as an child-element inherits these width.</p>
  
  <p>I give the (four) li-elements a width of 25% which results in expected 200px. In can see that in the developer-tools. </p>
  
  <p>But the 4 list-items don't stay in one row. The last item breaks into another row.</p>
  
  <p><a href="https://i.stack.imgur.com/3WcI2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3WcI2.png" alt="enter image description here"></a></p>
  
  <p>Currently I can see no reason why. 4 * 200px = 800px => <strong>It should match into the parent-element.</strong></p>
  
  <p>I could do : </p>
  
  <pre><code>ul li {
      ...
      width: calc(25% - 4px);
      ...
  }
  </code></pre>
  
  <p>... then it would work. But don't want to take that approach ...</p>
  
  <p>So therefore: </p>
  
  <p>Can someone tell me why I get these linebreak although it should match?</p>
  
  <p>Here's the code : </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>$rad: 10px;
  
  .content h2 {
    margin-top: 20px;
  }
  
  .content {
   background-color: #343434;
   color: white;
   width: 60%;
  }
  
  .wrap {
    max-width: 800px;
    margin: 50px auto;
    display: flex;
  }
  
  .left-column {
    background-color: #dedede;
    width: 10%;
  }
  
  .right-column {
    background-color: lighten(grey, 10%);
    width: 30%;
  }
  
  .column {
    padding: 0 25px;
    border-radius: $rad;
  }
  
  ul {
    list-style: none;
    padding-left: 0;
  }
  
  @media (max-width: 1024px) {
    .wrap {
      flex-direction: column;
    }
    
    .content {
      width: 100%;
      order: 3;
    }
    
    .left-column {
      width: 100%;
      order: 1;
    }
    
    .right-column {
      width: 100%;
      order: 2;
    }
    
    ul li {
      display: inline-block;
      background-color: #efefef;
      width: 25%;
      text-align: center;
      border-radius: $rad;
    }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="wrap"&gt;
    &lt;div class="left-column column"&gt;
      &lt;ul&gt;
        &lt;li&gt;One&lt;/li&gt;
        &lt;li&gt;Two&lt;/li&gt;
        &lt;li&gt;Three&lt;/li&gt;
        &lt;li&gt;Four&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
  
    &lt;div class="content column"&gt;
      &lt;h2&gt;Nam quam nunc blandit vel&lt;/h2&gt;
      &lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim.&lt;/p&gt;
      &lt;p&gt;Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus.&lt;/p&gt;
      &lt;p&gt;In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus.&lt;/p&gt;
    &lt;/div&gt;
  
    &lt;div class="right-column column"&gt;
      &lt;p&gt;RIGHT COLUMN - Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus.&lt;/p&gt;
      &lt;p&gt;Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>