<!DOCTYPE html><html><head> ???<title></title></head><style type="text/css"> ???.div{ ???????background: red; ???????width: 20%; ???????overflow: hidden; ???} ???.div:after{ ???????content: ‘‘; ???????display: block; ???????margin-top: 100%; ???}</style><body> ???<div class="div"></div></body></html>
css实现高度自适应正方形
原文地址:http://blog.51cto.com/12173069/2299007