动态居中更新进度Gif

ano*_*110 3 css ajax updateprogress

我正在使用Ajax updateprogress而且我附加了一个加载gif,问题是我怎么能强迫loading.gif在屏幕的中心,即使你在页面的最底部/顶部?有没有办法让它始终出现在中心?我希望用户在中心看到加载gif始终为他们通知页面仍在加载..

.CenterPB
    {
        position: absolute;
        left: 50%;
        top: 50%;
        margin-top: -20px; /* make this half your image/element height */
        margin-left: -20px; /* make this half your image/element width */
        width:auto;
        height:auto;
    }

   <asp:UpdateProgress ID="UpdateProgress1" runat="server" DynamicLayout="false">
    <ProgressTemplate>
        <div class="CenterPB" style="height: 40px; width: 40px;">
            <asp:Image ID="Image1" runat="server" ImageUrl="~/App_Themes/Default/images/progressbar1.gif"
                Height="35px" Width="35px" />
            Loading ...
        </div>
    </ProgressTemplate>
</asp:UpdateProgress>
Run Code Online (Sandbox Code Playgroud)

谢谢!

kas*_*mir 5

我假设你希望它保持在中间,即使滚动.然后你必须改变:

    position: absolute;
Run Code Online (Sandbox Code Playgroud)

    position: fixed;
Run Code Online (Sandbox Code Playgroud)