Centering an item vertical and horizontal

Guess. How hard would it be to position something horizontal and vertical on the canvas (the space in youtr browser where you see the content)? Not hard? No, indeed. If Internet-Explorer would be a good kid, it would not.

    .centered {      position: absolute;      top: 0;      right: 0;      bottom: 0;      left: 0;      width: 752px;      height: 429px;      margin: auto;    }
An then making a simple div, with the content you want centered inside it, should do.. Should, yes indeed. The margin-auto thingy should make all centered, if the div's sizes are fixed. But, yea you guessed it, it does not work in Internet Explorer six. So forget this little nifty thingy. The way to go is the old table trick. Sorry.

But there are some ways around, when using CSS, all with their own little problems though. Yust read thru the bloat of these people

Dit artikel verscheen op bler.webschuur.com. En is overgezet naar dit blog

in programming53

Over de auteur: Bèr Kessels is een ervaren webdeveloper met een grote passie voor techniek en Open Source. Een gouden combinatie om de techniek goed en efficiënt toe te passen. Volg @berkes op Twitter. Of lees meer over Bèr.

blog comments powered by Disqus