It is as easy as specifying a padding bottom the same size as the width in percent. So if you have a width of 50%, just use this example below
id or class{
width: 50%;
padding-bottom: 50%;
}
Here is a jsfiddle http://jsfiddle.net/kJL3u/2/
Edited version with responsive text: http://jsfiddle.net/kJL3u/394