div块中高度总是宽度的一半
1 <!doctype html> 2 <html> 3 <head> 4 <style type="text/css"> 5 body { 6 margin: 0; 7 padding: 0; 8 } 9 .inner { 10 color: red; 11 height: 0; 12 padding: 25% 0; 13 background-color: #3a9; 18 </style> 19 </head> 20 <body> 21 <div class="inner"> A </div> 22 </body> 23 </html>