CSS+DIV实现遮罩层(Mask)

时间:2024-03-06 18:23:23

CSS样式部分:

----------------------------------

<style type="text/css">
#loading-mask{
        position:absolute;
        left:0;
        top:0;
        width:100%;
        height:100%;
        z-index:20000;
       
    }
    #loading{
        position:absolute;
        left:45%;
        top:40%;
        padding:2px;
        z-index:20001;
        height:auto;
 }
    #loading .loading-indicator{
        background:white;
        color:#444;
        font:bold 20px tahoma,arial,helvetica;
        padding:10px;
        margin:0;
        height:auto;
    }
    #loading-msg {
        font: normal 18px arial,tahoma,sans-serif;
    }
</style>

 

HTML部分:

-------------------------------------------------

<div id=\'loading-mask\'></div>
<div id="loading">
    <div class="loading-indicator">
       <img src="large-loading.gif" width="32" height="32" style="margin-right:8px;float:left;vertical-align:top;"/> 
       <br/><span id="loading-msg">Loading ...</span>
    </div>
</div>

全文:http://www.cnblogs.com/simonwy/archive/2009/11/10/1599996.html