English 中文(简体)
IE: Centre and overlay a div on the Screen [los]
原标题:IE: center and overlay a div on the screen [closed]

以下法典在IE.,但NOT在IE如此。

I need to properly center the div on the screen -Right now the div is leaning too much to the bottom

I also need to make this div (id="loading") to cover the whole window -And take all the clicks to prevent clicks somewhere else.

It needs to be compatible with IE.

传真

<html>
<head>
<title>Overlay</title>
    <link href="loading.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
    <script type="text/javascript" src="loading.js"></script>
</head>
<body>
This paragraph is for testing
<br/>
Hello world!
<br/>
How are you?
<br/>
Be happy!
<br/>
<input id="cmd" type="button" value="Test" />
</body>
</html>

CSS

#loading {
    background-color: black;
    background-color: rgba(1, 1, 1, 0.7);
    bottom: 0;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
}

#loading_box {
    width: 150px;
    height: 35px;
    border: 5px solid #FFFFFF;
    padding: 5px;

    text-align: center;
    margin-top: 50%;
    margin-left: 50%;
    position: relative;
    top: -15.5px
}

#loading_img {
    width: 31px;
    height: 31px;
}

#loading_txt {
    color: #49a0dc;
    font-weight: bold;
    margin-left: 0.5em;
    font-family: "Arial Black", Gadget, sans-serif;
}

Sample file http://punkbunny.com/tmp/overlay/overlay.html

问题回答

使用:

#loading_box {
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -17px;
    margin-left: -75px;
}

http://www.un.org/Depts/DGACM/index_french.htm 采用这些办法将很难取得你重新开始的效果。

你的手法不正确,使信通风化。 改用这个词,看我们的位置:<! DOCTYPE html>





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签