I want to create a div that can change its width/height as the window's width changes.
Are there any CSS3 rules that would allow the height to change according to the width, while maintaining its aspect ratio?
I know I can do this via JavaScript, but I would prefer using only CSS.
转载于:https://stackoverflow.com/questions/1495407/maintain-the-aspect-ratio-of-a-div-with-css