title: How to make div responsive
body: <p>I'm using wordpress to build my website and i have a section that contains a div of items displayed as a grid.Everything works fine except for the case when the grid is only with 1 item.I want this 1 item to be centered in the div and the whole div to be responsive
  Here's my code:</p>
  
  <pre><code>echo '&lt;section class="our-team" id="resources"&gt;';
  
  
                  echo '&lt;div class="container"&gt;';
  
  
                      echo '&lt;div class="section-header"&gt;';
  
  
                          $zerif_events_title = get_theme_mod('zerif_events_title',__('Resources','zerif-lite'));//Title
  
                          if( !empty($zerif_events_title) ):
                              echo '&lt;h2 class="dark-text"&gt;'.__($zerif_events_title,'zerif-lite').'&lt;/h2&gt;';
                          endif;
  
                      echo '&lt;/div&gt;';
  
  
                      if(is_active_sidebar( 'sidebar-doctors' )):
                          echo '&lt;div class="row" data-scrollreveal="enter left after 0s over 0.1s"&gt;';
                              dynamic_sidebar( 'sidebar-doctors' );
                          echo '&lt;/div&gt; ';
                      else:
  
                      $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
                      $wp_query = new WP_Query( array('post_type' =&gt; 'resources', 'showposts' =&gt; '3', 'paged' =&gt; $paged) );
                      $count = $wp_query-&gt;post_count;
  
                      if( $wp_query-&gt;have_posts() ):
                       $i =1;
                          while ($wp_query-&gt;have_posts()) : $wp_query-&gt;the_post();
  
                           $url = get_post_meta($post-&gt;ID, '_location', true);
                           $permalink = get_permalink( $post-&gt;ID);
  
                           if($count == 1)
                           {
                           //
                           echo '&lt;div  style="position:relative;left:33%"&gt;';
                           }
                           if($count == 2)
                           {
  
                           echo "&lt;div class = 'col-md-6'&gt;";
                           }
                           else
                           {
                           echo "&lt;div class='col-md-4'&gt;";
                           }
                              if($url)
                              {
                              echo "&lt;a href = ".$url."&gt;";
                              echo the_post_thumbnail();
                              echo "&lt;/a&gt;";
                              echo "&lt;h6&gt;";
                              echo the_title();
                              echo "&lt;/h6&gt;";
                              echo substr(get_the_excerpt(), 0,170);  
  
  
  
                              }
                              else{
                              echo "&lt;a href = ".$permalink."&gt;";
                              echo the_post_thumbnail();
                              echo "&lt;/a&gt;";
                              echo "&lt;h6&gt;";
                              echo the_title();
                              echo "&lt;/h6&gt;";
                              echo substr(get_the_excerpt(), 0,170);  
  
                              }
                              echo "&lt;/div&gt;";  
                               $i++;
                                  if($i&gt;3)
                                  {
                                      echo "&lt;br&gt;";
                                      $i=1;
                                  }
  
                          endwhile;
                          if($count &gt; 2){
                          $page = get_permalink(  get_page_template_by_title( 'Resources' ) );
                              echo '&lt;a style ="position:relative;top:50px" text-align="right" href = "http://localhost/wordpress/?page_id=89"&gt; View All -&gt; &lt;/a&gt;';
                              }
                      endif;
  
  
                      endif;
  
  
  
  
                  echo '&lt;/div&gt;';
  
  
              echo '&lt;/section&gt;';
  </code></pre>