1

You can save the code below and try it out.

In firefox,it's full browser grey,but in IE(IE7 to be exact),it's not working.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style text="text/css">
.overlay {  
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height:100%;
    z-index:1000;
    background-color:grey;
}
</style>
</head>
<body style="font-size:62.5%;">

<div class="overlay"></div>

</body>
</html>

2 Answers 2

4

IE doesn't recognize the CSS color name grey. Try using a hex color, e.g., #ccc, and it will work. Alternatively, using gray (with an 'a', not an 'e') also works.

Note that this is standards-compliant, because W3C doesn't say anything about supporting alternate spellings of gray, and gray is indeed the color name according to the spec for CSS3.

Sign up to request clarification or add additional context in comments.

Comments

0

Try adding this to your style defs:

html, body {
    height: 100%;
}

On IE, body doesn't extend the full height of the viewport by default, and your overlay's container is body, so...

Edit Just tried it, and yours worked without the above, must be because body is statically positioned. Anyway, John Feminella figured it out; see his answer.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.