title: Unable to remove white space from right in responsive design HTML/CSS
body: <p>I am unable to remove the white space from right side when implementing responsive design. 
  I have used <strong>flex box</strong> to implement most of the layout.
  The window responds accurately and content adjusts accordingly but when scrolled, there is space on the right always! </p>
  
  <p>Hierarchy of classes:</p>
  
  <p>----> container</p>
  
  <p>--------> sidebar</p>
  
  <p>----------------> name-profession</p>
  
  <p>----------------> details</p>
  
  <p>------------------------> contact-item</p>
  
  <p>--------> content</p>
  
  <p><a href="https://i.stack.imgur.com/YkmzG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YkmzG.png" alt="screenshot-extra space on right"></a></p>
  
  <p>HTML:</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>* {
    margin: 0;
    padding: 0;
    font-family: Roboto;
    box-sizing: border-box;
  }
  
  html,
  body {
    height: 100%;
    background-color: #E5E6EA;
  }
  
  .container {
    display: flex;
    height: 100%;
  }
  
  @media screen and (max-width: 480px) {
    .container {
      flex-direction: column;
    }
  }
  
  
  /* Sidebar */
  
  .sidebar {
    background-color: #FFF;
    flex: 1;
    margin-right: 20px;
    width: 400px;
    flex: initial;
  }
  
  @media screen and (max-width: 480px) {
    .sidebar {
      width: 100%;
      margin-bottom: 40px;
      margin-right: 0;
    }
  }
  
  .name-profession {
    background-color: #56b293;
    padding: 20px;
    display: flex;
    align-items: center;
    flex-direction: column;
    color: #fff;
  }
  
  .name {
    font-size: 40px;
    font-weight: bold;
  }
  
  .profession {
    font-size: 20px;
  }
  
  .details {
    padding: 40px;
  }
  
  @media screen and (max-width: 480px) {
    .details {
      width: 300px;
      margin: 0 auto;
      position: relative;
    }
    .contact-item {}
  }
  
  .contact {
    margin-bottom: 20px;
  }
  
  .contact-item {
    display: flex;
    width: 400px;
    margin-bottom: 20px;
  }
  
  .contact-text {
    margin-left: 10px;
    font-size: 15px;
  }
  
  
  /* End Sidebar */
  
  
  /* Content */
  
  .content {
    background-color: #fff;
    flex: 2;
  }
  
  @media screen and (max-width: 480px) {
    .content {
      width: 100%;
      margin-bottom: 40px;
    }
  }
  
  
  /* End Content */
  
  
  /* Common */
  
  .large-heading {
    font-size: 25px;
    text-transform: uppercase;
    font-weight: bold;
  }
  
  .heading {
    font-size: 20px;
    text-transform: uppercase;
    font-weight: bold;
  }
  
  .content-text {
    color: grey;
  }
  
  .circle-avatar {
    width: 40px;
    height: 40px;
    background-color: #56b293;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .circle-avatar img {
    width: 30px;
    height: 30px;
    padding: 5px;
  }
  
  .dotted-separator {
    border-top: 3px dashed #E5E6EA;
    width: 100%;
  }
  
  .content-padding {
    padding: 40px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet"&gt;
  &lt;div class="container"&gt;
    &lt;!--Sidebar--&gt;
    &lt;div class="sidebar"&gt;
      &lt;div class="name-profession"&gt;
        &lt;p class="name"&gt;Gurleen Sethi&lt;/p&gt;
        &lt;p class="profession"&gt;Software Developer&lt;/p&gt;
      &lt;/div&gt;
  
      &lt;div class="details"&gt;
        &lt;p class="contact large-heading"&gt;Contact&lt;/p&gt;
        &lt;div class="contact-item"&gt;
          &lt;div class="circle-avatar"&gt;
            &lt;img src="images/home.png"&gt;
          &lt;/div&gt;
          &lt;div class="contact-text"&gt;
            &lt;p class="heading"&gt;Address&lt;/p&gt;
            &lt;p class="content-text"&gt;948 New Geeta Colony&lt;/p&gt;
          &lt;/div&gt;
        &lt;/div&gt;
  
        &lt;div class="contact-item"&gt;
          &lt;div class="circle-avatar"&gt;
            &lt;img src="images/calendar.png"&gt;
          &lt;/div&gt;
          &lt;div class="contact-text"&gt;
            &lt;p class="heading"&gt;DATE OF BIRTH&lt;/p&gt;
            &lt;p class="content-text"&gt;18 August 1996&lt;/p&gt;
          &lt;/div&gt;
        &lt;/div&gt;
  
        &lt;div class="contact-item"&gt;
          &lt;div class="circle-avatar"&gt;
            &lt;img src="images/phone.png"&gt;
          &lt;/div&gt;
          &lt;div class="contact-text"&gt;
            &lt;p class="heading"&gt;Phone&lt;/p&gt;
            &lt;p class="content-text"&gt;+91 72908 32506&lt;/p&gt;
          &lt;/div&gt;
        &lt;/div&gt;
  
        &lt;div class="contact-item"&gt;
          &lt;div class="circle-avatar"&gt;
            &lt;img src="images/mail.png"&gt;
          &lt;/div&gt;
          &lt;div class="contact-text"&gt;
            &lt;p class="heading"&gt;Email&lt;/p&gt;
            &lt;p class="content-text"&gt;contactgurleensethi@gmail.com&lt;/p&gt;
          &lt;/div&gt;
        &lt;/div&gt;
  
        &lt;div class="contact-item"&gt;
          &lt;div class="circle-avatar"&gt;
            &lt;img src="images/world.png"&gt;
          &lt;/div&gt;
          &lt;div class="contact-text"&gt;
            &lt;p class="heading"&gt;Website&lt;/p&gt;
            &lt;p class="content-text"&gt;www.thetechnocafe.com&lt;/p&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  
    &lt;!--Content--&gt;
    &lt;div class="content"&gt;
      &lt;div class="about content-padding"&gt;
        &lt;p class="heading" style="margin-bottom: 20px;"&gt;About&lt;/p&gt;
        &lt;p class="content-text"&gt;Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
          It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.&lt;/p&gt;
      &lt;/div&gt;
  
      &lt;div class="dotted-separator"&gt;&lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>