Saturday, 15 September 2012

html - IE7 position absolute with margin auto bug -



html - IE7 position absolute with margin auto bug -

i have problem positioning , margin in ie7. have got div absolute position , auto margin.

position: absolute; top: 0; right: 0; left: 0; bottom: 0; margin: auto;

this div should centered relative position parent. in ie7 not working. here illustration of working code http://jsfiddle.net/3zwka/

vertical centering in css pita, when want ie7 (or ie6) support. there many ways it, each come kind of drawback. method corresponds method 4 in linked article, , known malfunction in ie < 8.

for elements fixed width , height though, more robust method (method 2 in article) consists of positioning @ top: 50%; left: 50% , subtracting half of width top , left margins. works in browsers. here, have fiddle.

html css internet-explorer-7

No comments:

Post a Comment