title: How to set tab height to content height
body: <p>I have incorporated a JQuery tab into my website, however I want my tabs to expand and contract the height to the content inside. For instance at the moment my first tab expands to the height of the content inside, when I go to the second tab it stays at the height of the first tab, even though it has much less content. Sorry if this is confusing.</p>
  
  <p>Here is the code for the tab:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
      $(document).ready(function() {
  
  //Default Action
  $(".tab_content").hide(); //Hide all content
  $("ul.tabs li:first").addClass("active").show(); //Activate first tab
  $(".tab_content:first").show(); //Show first tab content
  
  //On Click Event
  $("ul.tabs li").click(function() {
      $("ul.tabs li").removeClass("active"); //Remove any "active" class
      $(this).addClass("active"); //Add "active" class to selected tab
      $(".tab_content").hide(); //Hide all tab content
      var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
      $(activeTab).fadeIn(); //Fade in the active content
      return false;
  });
  
    });
    &lt;/script&gt;
  </code></pre>
  
  <p>And here is a piece of code I use to control the height of the <code>div</code> with the surrounding <code>div</code> wrapper:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(function(){
  var height = $("#content").height();
  $(".tab_container").height(height);
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>If you need any more info let me know and I will provide it.</p>