20K views
CSSAdd prefixes
1button { 2 display: flex; 3 flex-direction: column; 4 justify-content: center; 5 align-items: center; 6 padding: 1em; 7 border: 0px solid transparent; 8 background-color: rgba(100,77,237,0.08); 9 border-radius: 1.25em; 10 transition: all 0.2s linear; 11} 12 13button:hover { 14 box-shadow: 3.4px 2.5px 4.9px rgba(0, 0, 0, 0.025), 15 8.6px 6.3px 12.4px rgba(0, 0, 0, 0.035), 16 17.5px 12.8px 25.3px rgba(0, 0, 0, 0.045), 17 36.1px 26.3px 52.2px rgba(0, 0, 0, 0.055), 18 99px 72px 143px rgba(0, 0, 0, 0.08); 19} 20 21.tooltip { 22 position: relative; 23 display: inline-block; 24} 25 26.tooltip .tooltiptext { 27 visibility: hidden; 28 width: 4em; 29 background-color: rgba(0, 0, 0, 0.253); 30 color: #fff; 31 text-align: center; 32 border-radius: 6px; 33 padding: 5px 0; 34 position: absolute; 35 z-index: 1; 36 top: 25%; 37 left: 110%; 38} 39 40.tooltip .tooltiptext::after { 41 content: ""; 42 position: absolute; 43 top: 50%; 44 right: 100%; 45 margin-top: -5px; 46 border-width: 5px; 47 border-style: solid; 48 border-color: transparent rgba(0, 0, 0, 0.253) transparent transparent; 49} 50 51.tooltip:hover .tooltiptext { 52 visibility: visible; 53}
HTML
1<button class="tooltip"> 2 <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20" height="25" width="25"> 3 <path fill="#6361D9" d="M8.78842 5.03866C8.86656 4.96052 8.97254 4.91663 9.08305 4.91663H11.4164C11.5269 4.91663 11.6329 4.96052 11.711 5.03866C11.7892 5.11681 11.833 5.22279 11.833 5.33329V5.74939H8.66638V5.33329C8.66638 5.22279 8.71028 5.11681 8.78842 5.03866ZM7.16638 5.74939V5.33329C7.16638 4.82496 7.36832 4.33745 7.72776 3.978C8.08721 3.61856 8.57472 3.41663 9.08305 3.41663H11.4164C11.9247 3.41663 12.4122 3.61856 12.7717 3.978C13.1311 4.33745 13.333 4.82496 13.333 5.33329V5.74939H15.5C15.9142 5.74939 16.25 6.08518 16.25 6.49939C16.25 6.9136 15.9142 7.24939 15.5 7.24939H15.0105L14.2492 14.7095C14.2382 15.2023 14.0377 15.6726 13.6883 16.0219C13.3289 16.3814 12.8414 16.5833 12.333 16.5833H8.16638C7.65805 16.5833 7.17054 16.3814 6.81109 16.0219C6.46176 15.6726 6.2612 15.2023 6.25019 14.7095L5.48896 7.24939H5C4.58579 7.24939 4.25 6.9136 4.25 6.49939C4.25 6.08518 4.58579 5.74939 5 5.74939H6.16667H7.16638ZM7.91638 7.24996H12.583H13.5026L12.7536 14.5905C12.751 14.6158 12.7497 14.6412 12.7497 14.6666C12.7497 14.7771 12.7058 14.8831 12.6277 14.9613C12.5495 15.0394 12.4436 15.0833 12.333 15.0833H8.16638C8.05588 15.0833 7.94989 15.0394 7.87175 14.9613C7.79361 14.8831 7.74972 14.7771 7.74972 14.6666C7.74972 14.6412 7.74842 14.6158 7.74584 14.5905L6.99681 7.24996H7.91638Z" clip-rule="evenodd" fill-rule="evenodd"></path> 4 </svg> 5 <span class="tooltiptext">remove</span> 6</button>