<p> Mouse over the button below: </p> <br/> <button class="button"> <img class="icon second-icon" src="//ssl.gstatic.com/bt/C3341AA7A1A076756462EE2E5CD71C11/1x/bt_compose2_1x.png" /> <img class="icon first-icon" src="//ssl.gstatic.com/bt/C3341AA7A1A076756462EE2E5CD71C11/2x/bt_speed_dial_2x.png" /> </button>
.button { background-color: #db4437; height: 56px; width: 56px; border: none; border-radius: 50%; box-shadow: 0 0 4px rgba(0, 0, 0, .14), 0 4px 8px rgba(0, 0, 0, .28); box-sizing: content-box; cursor: pointer; outline: none; padding: 0; position: relative; -webkit-transform: scale(1) rotate(360deg); transform: scale(1) rotate(360deg); -webkit-transition: -webkit-transform 150ms cubic-bezier(.4, 0, 1, 1); transition: transform 150ms cubic-bezier(.4, 0, 1, 1); } .button:hover { box-shadow: 0 0 6px rgba(0, 0, 0, .16), 0 6px 12px rgba(0, 0, 0, .32); -webkit-transition: box-shadow 150ms cubic-bezier(0, 0, .2, 1); transition: box-shadow 150ms cubic-bezier(0, 0, .2, 1); } .icon { background-size: 24px; display: block; height: 24px; margin: auto; width: 24px; } .second-icon, .first-icon { left: 0; margin-left: 16px; margin-top: 16px; position: absolute; top: 0; -webkit-transition: all .2s cubic-bezier(.4, 0, .2, 1); transition: all .2s cubic-bezier(.4, 0, .2, 1); } .second-icon, .button:hover .first-icon { opacity: 0; -webkit-transform: rotate(225deg); transform: rotate(225deg); } .button:hover .second-icon { opacity: 1; visibility: visible; -webkit-transform: rotate(360deg); transform: rotate(360deg); }