Reputation: 3774
How to an image in the center of a DIV (both vertically and horizontally) ?
Upvotes: 0
Views: 9944
Reputation: 5897
Give this a go:
div.wrapper{
width:75px;
height:75px;
}
img{
width:50px;
height:50px;
display:block;
/* For vertical center - margin: 0 auto;
For horizontal center - margin: auto 0px;*/
margin: auto auto;
}
Upvotes: 2