根據canisue(http://caniuse.com/#search=border-radius),border-radius相容性如下圖所示:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title></title> <style type="text/css"> * { margin: 0; padding: 0; } #header { width: 400px; height: 400px; margin: 10px; border-radius: 10px; border: 1px solid red; } </style> </head> <body> <div id="header"> </div> </body> </html>
IE8瀏覽器效果:
border-radius在IE8瀏覽器相容方案:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title></title> <style type="text/css"> * { margin: 0; padding: 0; } #header { width: 400px; height: 400px; margin: 10px; border-radius: 10px; border: 1px solid red; /*关键属性设置 需要把路径设置好*/ behavior: url(PIE.htc); } </style> </head> <body> <div id="header"> </div> </body> </html>
IE8瀏覽器下效果:
PIE.HTC下載位址:http://css3pie.com/
PIE可以處理CSS3的一些屬性,如:
#
以上是border-radius IE8相容處理方法介紹的詳細內容。更多資訊請關注PHP中文網其他相關文章!