CodePen

HTML

            
              <div class="outer">
  <div class="image"></div>
  <div class="text">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus lectus massa, pulvinar at iaculis sed, feugiat in sem. In faucibus lorem vel lectus vehicula ut dignissim libero suscipit. Quisque convallis nunc a ipsum gravida egestas. Fusce ipsum felis, laoreet eu placerat ac
  </div>
</div>
            
          
!

CSS

            
              @import "compass/css3";

.outer{
  border:2px solid blue;
  padding:10px;
  width:auto; 
  background:green;
  .image{
    width:300px;
    height:100px;
    background:red;
  }
  .text{
    width:100%;
    background:yellow;
  }
}
            
          
!

JavaScript

            
              $(document).ready(function() {
  
  function checkHeight(obj){
    obj.width(obj.children(".image").outerWidth());
  }
  checkHeight($(".outer"));
});
            
          
!
999px
Loading ..................