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
https://forums.phpfreaks.com/topic/188119-ie-problems-again-for-centering-div/
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;
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.