IE absolute position issue


I’m creating this temporary webpage, the css works on FF & Chrome but not IE11.

My CSS codes:

#container {
	height: 100%;
	width: 100%;
#contents {
	padding: 5%;
	max-width: 980px;
	min-width: 320px;
	max-height: 540px;
	margin-left: auto;
	margin-right: auto;
	margin-top: auto;
	margin-bottom: auto;
	position: absolute;
	top: 0; bottom: 0; left: 0; right: 0;

IE11 will centralize “contents” only if I change max-width to width. Is there any ie hack I can apply to make this work on IE11 and older IEs?

EDITED by admin to include code tags.

Could you put up a full demo that shows the problem at CodePen? That would make it easier to help, along with an indication of which version of IE you are working with.

I’ve uploaded it here: , I’m working with IE11

ermm… I don’t have a CodePen account yet :blush:

Our resident guru @paulOB recently posted a very nice tutorial on how to deal with this: Centre absolute elements

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.