Jump to content

I.E problems (again) for centering div


squiblo

Recommended Posts

the code below works in all browers for positioning the div in the middle of the page apart from I.E because they are GAY and think they are special.

Any ideas on how to get this to work, thanks.

 

.black_back {
width: 510px;
height: 510px;
position:fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
margin: auto;
background-color:black;
border:1px solid black;
/* for IE */
filter:alpha(opacity=30);
/* CSS3 standard */
opacity:0.3;
z-index: 2;
}

 

<div class='black_back'> TEXT </div>

Link to comment
Share on other sites

Try this:

 

.black_back
{
width: 510px;
height: 510px;
position:fixed;
top: 50%;
left: 50%;
margin-left:-255px;
margin-top:-255px;
background-color:black;
border:1px solid black;
/* for IE */
filter:alpha(opacity=30);
/* CSS3 standard */
opacity:0.3;
z-index: 2;
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.