I need to center an image, at least horizontally, without using tables and workable on at least Internet Explorer 8. (Internet Explorer 7 too if possible).
I need a solution similar to an earlier asked question on Stack Overflow, Center an image inside a div?, but doing it using tables, which is not acceptable solution here.
I tried a Fiddle with "margin:0px auto", which work for all other elements, but it is not working for an image. Quick code is as follows.
HTML
<div class="outer">
<img src="https://m.ak.fbcdn.net/profile.ak/hprofile-ak-ash4/195658_100001734379625_1121483775_q.jpg" width="100" height="100" />
</div>
CSS
.outer{
width:300px;
border:1px #000 solid;
padding:5px;
}.outer img{
border:1px #F00 solid;
margin:0 auto;
}
Is there any pure CSS solution, if possible but not necessarily, applicable for Internet Explorer 7 too?