用兩種方式已實(shí)現(xiàn)婴程,使用ie-css3.htc與pie.htc已實(shí)現(xiàn)!
獲取htc位置,已上傳到碼云抱婉!
https://gitee.com/kong_qing_rong/daily-component-library?_from=gitee_search
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
.border-radius-temp{
width: 40px;
height: 40px;
margin: 10px;
background-color: red;
text-align: center;
display: table-cell;
vertical-align: middle;
border-radius: 20px;
color: white;
font-weight: bolder;
border: 1px solid red;
/*關(guān)鍵屬性設(shè)置 需要把路徑設(shè)置好*/
behavior: url(./css/PIE.htc);
}
.radius{
width:40px;
height: 40px;
margin: 10px;
background-color: red;
text-align: center;
display: table-cell;
vertical-align: middle;
color: white;
font-weight: bolder;
border-radius: 20px;
border:1px solid red;
behavior:url(./css/ie-css3.htc);
}
</style>
</head>
<body>
<div id="pieHtc" class="border-radius-temp"></div>
<div id="ieCss3Htc" class="radius"></div>
<script type="text/javascript">
var pieHtc = document.getElementById("pieHtc");
pieHtc.innerText = "123";
var ieCss3Htc = document.getElementById("ieCss3Htc");
ieCss3Htc.innerText = "456";
</script>
</body>
</html>
htc存放位置圖:
至于為什么ie8與ie6,7,顯示不同档叔,是因?yàn)閕e6,7不支持display: table-cell;該屬性值!