Reputation: 4491
I have a pure CSS modal dialog set up like this
div {
position:fixed;
top:50%;
left:50%;
margin:-26% 0 0 -26%;
width:46%;
height:46%;
padding:3%;
}
This div displays centered in webkit browsers. In FF however, it's almost touching the top of the screen.
Upvotes: 0
Views: 104
Reputation: 1123
Rather than using margins, you could do:
top: 25%;
left: 25%;
I don't think I'd combine margins and fixed positioning.
Upvotes: 3