No-Library (pure JS), HTML, CSS, JavaScript
jQuery 2.1.0, HTML, CSS, JavaScript
After many attempts, I finally found this pretty simple solution to archive what I wanted to do. The div will always handle its size with its immediate neighbor.
jQuery 1.8.3, HTML, CSS, CoffeeScript