You need to put background
properties outside the hover
too, so it knows what to return to when not on hover.
e.g.
.tile{
float:left;
margin:1px;
width:450px;
height:450px;
overflow:hidden;
background-size:450px 450px;
background-position:0px 0px;
}
And if you want it to transition on mouseover and when you take the mouse off, you put the transition on .tile
and not .tile:hover
Side note
You should avoid using inline styles where you can use a stylesheet.
Put your background image in .tile
rather than using the style
attribute.
Full CSS:
.tile{
float:left;
margin:1px;
width:450px;
height:450px;
overflow:hidden;
background-size:450px 450px;
background-image:url(http://www.placehold.it/450x450);
background-position:0px 0px;
transition:all 0.5s ;
-webkit-transition:all 0.5s ;
-o-transition:all 0.5s ;
-moz-transition:all 0.5s ;
}
.tile:hover {
background-size:550px 550px;
background-position:-50px -50px;
}