.container{ left: 100px; width: 208px; height: 370px; position: relative; top: 85px; left: 199px; overflow: hidden; font-family: Raleway; } .view-details{ font-size: 14px; padding: .5em; } .view-details p{ border-bottom: 1px solid #f1f1f1; margin-bottom: 3px; padding-bottom: 15px; } .topimg{ width: 30%; border:1px solid black; padding: 20px; border-radius: 10%; margin-left: 25%; } .backimg{ transition: .3s; cursor: pointer; margin-left: 40%; width: 15%; } img.backimg:hover{ transform: scale(1.20); } .view-list ul{ display: flex; flex-direction: column; flex-wrap: wrap; justify-content: center; margin: 0; padding: 0; } .view-list li{ cursor: pointer; transition: .3s; flex: 1 0 auto; list-style: none; display: inline-block; padding: 0.28em 1em; } .view-list li:hover, .view-details button:hover{ color: #fff; background-color: #abcdef; } .iphone{ width: 470px; height: 556px; position: absolute; background: url('http://boudaoud.samir.free.fr/test/iphone6_transparent.png') no-repeat; top: 0; left: 0; } .view{ position: absolute; top: 0; left: 0; bottom: 0; right: 0; transition: 300ms; } .view-details{ transform: translateX(100%); } .switch .view-list{ transform: translateX(-100%); } .switch .view-details{ transform: translateX(0); }