31 dic 2010

Center DIV/Container/Layer IE : flumpCakes

This is a demo to show how to center a DIV in the center of the screen from Internet Explorer 4 and up. Including all modern browsers too.
The trick is to add text-align: center; to the body selector, then add the usual margin: 0 auto; to the container selector which you want centered. Apply text-align: left; on the container to counter the center align for body.
View this pages source code to see how it's done

No hay comentarios:

Publicar un comentario