A Classy Solution to Aspect Ratio in Pure CSS

There is not currently a property in CSS to set the aspect ratio of an element. Surprising, I know. If there is one, then you're probably reading this years from time of writing. There is a media feature for detecting the aspect ratio of a display but not for actually setting it. Fair warning: my solution is not foolproof but maybe it will work for you.