div#showPhoto{ float: right; height:325px; width:325px; overflow: hidden; position: relative; text-align: center; background-image: url("../interface/mariage/bkgnd_frame-trans.png") ; } div#showPhoto[id]{ display: table; position: static; } div#centeredPhoto{ position: absolute; top: 50%; } div#centeredPhoto[id]{ display: table-cell; vertical-align: middle; position: static; text-align: center;} div#realPhoto{ position: relative; top: -50%; left: -50%; } div#realPhoto[id]{ position: static; }