title: how to make a div children fit in a parent div with a smaller width
body: <p>I have a div as a parent div containing dynamically created children div as much as,but my problem is i want the children div to be inline so users can scroll horizontal to see more of the children div as they scroll but my is scrolling vertically instead of horizontal and i try setting the overflow-y to hidden but still not the children div are not inline once.</p>
  
  <pre><code>&lt;div id="frnd_r_s_c"&gt;
      &lt;?php 
          $sqlfrnds = $db_connect-&gt;prepare("select * from users where id!=?");
          $sqlfrnds-&gt;bind_param('s',$row["id"]);
          $sqlfrnds-&gt;execute();
          $result = $sqlfrnds-&gt;get_result();
  
          while($rows = $result-&gt;fetch_assoc()){
  
      ?&gt;
      &lt;div class="suggest-frnd"&gt;
          &lt;div id="s_f_exit"&gt;&amp;nbsp;&amp;times;&lt;/div&gt;
          &lt;div class="suggest-frnd-img"&gt;
              &lt;img src="&lt;?php  ?&gt;" &gt;
          &lt;/div&gt;
          &lt;div class="suggest-frnd-n-add"&gt;
              &lt;div id="suggest-frnd-n"&gt;&lt;?php echo $rows["u_firstname"]."&amp;nbsp;";echo $rows["u_othernames"]; ?&gt;&lt;/div&gt;
          &lt;div&gt;
              &lt;form id="s_frnd_form"&gt;
                  &lt;input type="hidden" name="s_frnd_id" value="&lt;?php echo $rows['id']; ?&gt;"&gt;
                  &lt;input type="submit" name="add_frnd" value="ADD"&gt;
              &lt;/form&gt;
         &lt;/div&gt;
     &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;?php
      }
  ?&gt;
  &lt;div class="clear"&gt;&lt;/div&gt;
  &lt;/div&gt; 
  
  
  /*style for parent div*/
  #frnd_r_s_c{
      width:450px;
      height:200px;
      background:blue;
      margin-left:20px;
      overflow-y:hidden;
      overflow-x:scroll;
  }
  
  /*floating the children div left to be able to display inline*/
  #frnd_r_s_c &gt;div{
      float:left;
  }
  </code></pre>
  
  <p>this is the dynamic create ones</p>
  
  <pre><code>&lt;div id="frnd_r_s_c"&gt;
                                                                                            &lt;div class="suggest-frnd"&gt;
                                                          &lt;div id="s_f_exit"&gt;&amp;nbsp;&amp;times;&lt;/div&gt;
                                                           &lt;div class="suggest-frnd-img"&gt;
                                                                &lt;img src="" &gt;
                                                           &lt;/div&gt;
                                                           &lt;div class="suggest-frnd-n-add"&gt;
                                                               &lt;div id="suggest-frnd-n"&gt;ekene&amp;nbsp;gabriel&lt;/div&gt;
                                                               &lt;div&gt;&lt;form id="s_frnd_form"&gt;
                                                                 &lt;input type="hidden" name="s_frnd_id" value="5"&gt;
                                                                 &lt;input type="submit" name="add_frnd" value="ADD"&gt;
                                                               &lt;/form&gt;&lt;/div&gt;
                                                           &lt;/div&gt;
                                                     &lt;/div&gt;
  
                                                                                                           &lt;div class="suggest-frnd"&gt;
                                                           &lt;div id="s_f_exit"&gt;&amp;nbsp;&amp;times;&lt;/div&gt;
                                                           &lt;div class="suggest-frnd-img"&gt;
                                                                &lt;img src="" &gt;
                                                           &lt;/div&gt;
                                                           &lt;div class="suggest-frnd-n-add"&gt;
                                                               &lt;div id="suggest-frnd-n"&gt;ebuka&amp;nbsp;gabriel&lt;/div&gt;
                                                               &lt;div&gt;&lt;form id="s_frnd_form"&gt;
                                                                 &lt;input type="hidden" name="s_frnd_id" value="14"&gt;
                                                                 &lt;input type="submit" name="add_frnd" value="ADD"&gt;
                                                               &lt;/form&gt;&lt;/div&gt;
                                                           &lt;/div&gt;
                                                     &lt;/div&gt;
  
                                                                                                           &lt;div class="suggest-frnd"&gt;
                                                           &lt;div id="s_f_exit"&gt;&amp;nbsp;&amp;times;&lt;/div&gt;
                                                           &lt;div class="suggest-frnd-img"&gt;
                                                                &lt;img src="" &gt;
                                                           &lt;/div&gt;
                                                           &lt;div class="suggest-frnd-n-add"&gt;
                                                               &lt;div id="suggest-frnd-n"&gt;kc&amp;nbsp;kelvin&lt;/div&gt;
                                                               &lt;div&gt;&lt;form id="s_frnd_form"&gt;
                                                                 &lt;input type="hidden" name="s_frnd_id" value="15"&gt;
                                                                 &lt;input type="submit" name="add_frnd" value="ADD"&gt;
                                                               &lt;/form&gt;&lt;/div&gt;
                                                           &lt;/div&gt;
                                                     &lt;/div&gt;
  
                                                                                                           &lt;div class="suggest-frnd"&gt;
                                                           &lt;div id="s_f_exit"&gt;&amp;nbsp;&amp;times;&lt;/div&gt;
                                                           &lt;div class="suggest-frnd-img"&gt;
                                                                &lt;img src="" &gt;
                                                           &lt;/div&gt;
                                                           &lt;div class="suggest-frnd-n-add"&gt;
                                                               &lt;div id="suggest-frnd-n"&gt;ecellent &amp;nbsp;chimezie&lt;/div&gt;
                                                               &lt;div&gt;&lt;form id="s_frnd_form"&gt;
                                                                 &lt;input type="hidden" name="s_frnd_id" value="16"&gt;
                                                                 &lt;input type="submit" name="add_frnd" value="ADD"&gt;
                                                               &lt;/form&gt;&lt;/div&gt;
                                                           &lt;/div&gt;
                                                     &lt;/div&gt;
  
                                                                                                           &lt;div class="suggest-frnd"&gt;
                                                           &lt;div id="s_f_exit"&gt;&amp;nbsp;&amp;times;&lt;/div&gt;
                                                           &lt;div class="suggest-frnd-img"&gt;
                                                                &lt;img src="" &gt;
                                                           &lt;/div&gt;
                                                           &lt;div class="suggest-frnd-n-add"&gt;
                                                               &lt;div id="suggest-frnd-n"&gt;ecellent &amp;nbsp;chimezie&lt;/div&gt;
                                                               &lt;div&gt;&lt;form id="s_frnd_form"&gt;
                                                                 &lt;input type="hidden" name="s_frnd_id" value="17"&gt;
                                                                 &lt;input type="submit" name="add_frnd" value="ADD"&gt;
                                                               &lt;/form&gt;&lt;/div&gt;
                                                           &lt;/div&gt;
                                                     &lt;/div&gt;
  
                                                                                                &lt;div class="clear"&gt;&lt;/div&gt;
                                    &lt;/div&gt;
  </code></pre>