css div實現的遮罩層完美兼容IE6-IE9 FireFox
Html代碼:
復制代碼代碼如下:
div id="black_overlay" style="display: none;"/div
div style="display: none;" id="load_content"
div style="float: left; padding-top: 12px; padding-left: 5px;"
img src="https://www.questions.com.cn/dnjc/images/progressBar.gif" /
/div
div style="float: left; padding-top: 15px;"數據加載中,請稍后.../div
/div
CSS樣式:
復制代碼代碼如下:
/*loading加載遮罩層css*/
#black_overlay
{
position: fixed;
z-index: 1000;
width: 100%;
height: 100%;
top: 0;
left: 0;
filter: alpha(opacity=80);
opacity: 0.8;
overflow: hidden;
background-color: #000;
}
*html
{
background: url(*) fixed;
}
*html body
{
margin: 0;
height: 100%;
}
/*IE6*/
*html #black_overlay
{
position: absolute;
left: expression(documentElement.scrollLeftdocumentElement.clientWidth - this.offsetWidth);
top: expression(documentElement.scrollTopdocumentElement.clientHeight - this.offsetHeight);
}
#load_content
{
display: none;
position: absolute;
top: 40%;
left: 40%;
width: 200px;
height: 50px;
border: 16px solid #FFF;
border-bottom: none;
background-color: white;
z-index: 1002;
overflow: auto;
font-size: 14px;
font-weight: bold;
}
效果圖:
IE6:

其他版本效果:就不一一貼圖了 。

相關經驗推薦
- 兼容ie的內陰影和外陰影實現效果及測試代碼
- IE6、IE7、IE8、Firefox兼容性CSS HACK代碼及示例
- 寫CSS樣式做瀏覽器兼容時區別ie8和ie9的方法
- CSS解決方案:IE6中遇到png兼容性
- CSS HACK收集:關于IE6/FF/google等瀏覽器hack的方法詳細
- CSS Hack大全-教你如何區分出IE6-IE10、FireFox、Chrome、Opera
- 通過注冊表實現 如何阻止Internet Explorer更新為IE10
- IE與fox好多不兼容的問題 div+css學習筆記
- IE與Firefox的CSS兼容大全 推薦
- ie10 css hack 條件注釋等兼容方式整理
