@import url("https://fonts.googleapis.com/css?family=Raleway:400,500,700&display=swap"); body { height: 100vh; margin: 0; display: grid; place-items: center; background: rgba(205, 207, 219, 0.2); } .multi-button { padding: 8px 10px; border-radius: 50px; background: #fff; border: 0.5px solid rgba(146, 152, 176, 0.4); box-shadow: 0 0 10px rgba(146, 152, 176, 0.2), 4px 4px 10px rgba(146, 152, 176, 0.2); cursor: default; } .multi-button button { border: 0 solid transparent; background: transparent; padding: 10px 30px; margin: 0 -2px; color: #273043; font-size: 17px; border-radius: 12px; cursor: pointer; position: relative; top: 0; left: 0; outline: none; transition: background 0.2s ease-in-out; } .multi-button button:first-child { border-top-left-radius: 40px; border-bottom-left-radius: 40px; } .multi-button button:last-child { border-top-right-radius: 40px; border-bottom-right-radius: 40px; } .multi-button button div { position: absolute; top: -43px; left: calc(50% - 40px); width: 80px; font-size: 13px; color: #fff; background: rgba(20, 25, 36, 0.7); border-radius: 16px; line-height: 30px; font-family: 'Raleway', Arial, sans-serif; text-align: center; font-weight: 500; letter-spacing: 1px; box-shadow: 0 0 5px rgba(39, 48, 68, 0.3), 1px 1px 5px rgba(39, 48, 68, 0.2); display: none; cursor: pointer; } .multi-button button:hover { background: #f0f1f4; } .multi-button button:hover div { display: block; animation: tooltip-animation-normal 0.3s ease-out forwards; } .multi-button button:hover div.animate-right { animation: tooltip-animation-right 0.3s ease-out forwards; } .multi-button button:hover div.animate-left { animation: tooltip-animation-left 0.3s ease-out forwards; } .multi-button button:active { outline: none; background: #d6d8e1; } @keyframes tooltip-animation-right { 0% { transform: translateX(-75px); } 100% { transform: translateX(0); } } @keyframes tooltip-animation-left { 0% { transform: translateX(75px); } 100% { transform: translateX(0); } } @keyframes tooltip-animation-normal { 0% { transform: translateY(-20px); } 100% { transform: translateY(0); } }