This question Height equal to dynamic width (CSS fluid layout) seems to have a good CSS-only answer by Nathan Ryan. It is also worth reading the comments below his answer for further explanation. Hope this helps.
If you find that the solution is too complicated, you might want to pay more attention to what you are trying to achieve if someone has a good alternative solution.
Flam
source share