It's not that I always take it with Internet Explorer, it's just that damn thing every Web development (HTML and CSS) seems not work with the browser - still - the most common (one day someone will explain why). ; ad esempio ecco come posizionare un div al centro dello schermo: A very convenient method to place an item in the middle of the browser window is to the property sfrutture auto style margin , for example, here is how to position a div in the center of the screen:
1 | width : 300px ; height : 200px ; margin : 0 auto } div # box {width: 300px; height: 200px; margin: 0 auto} |
Unfortunately (needless to say) that does not work on IE5! One way to overcome this problem is to use an additional "defect" in the use of IE5 style text-align . In practice it would be:
1 2 | : center } body {text-align: center} width : 300px ; height : 200px ; margin : 0 auto ; text-align : left } div # box {width: 300px; height: 200px; margin: 0 auto; text-align: left} |
In all honesty I personally refuse to write "this zozzata", but it may always come in handy. However the purpose of this "trick" was precisely bring to light the technique of margin auto !










Just trick. When necessary, I try to avoid the text-align the body and create a div with text-align center and width 100% where then insert the div to center.
You say that you refuse to accept this "zozzata" (and how to blame you) .. so how do you do when you need to hit? You plug your nose or have other methods?
@ Fred: I know it will seem absurd, but when I can, IE does not consider it right! Indeed, to tell you the truth, now for me is basically the anti-IE browser! . However, as an alternative there are also tables, maybe even more "zozzata" the
bodywithtext-align:center. But yeah, you said well you ... when I am forced, I plug my nosetables? I pretend not to have read ..
I just wanted to be sure there was some other method. Thank you for your reply! I think your a brave (not to be considered ie) .. I read the statistics of my sites, and unfortunately it seems to me that the time is not ripe yet. But I'm confident, you must stand still for long.