兼容性— IE6下子元素寬高會撐大父級
阿新 • • 發佈:2017-05-12
color html image oct 編寫代碼 ack box ie6 images
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style> .box{ width: 200px; height: 200px; border:10px solid black; } .content{ width: 400px; height: 400px; background: red; } </style> </head> <body> <div class="box"> <div class="content"></div> </div> </body> </html>
IE6下效果
其他瀏覽器下效果
解決方案:編寫代碼時,盡量使子級元素寬高小於父級
兼容性— IE6下子元素寬高會撐大父級