#e8e8e8
1.button { 2 width: 50px; 3 height: 50px; 4 border-radius: 50%; 5 background-color: rgb(20, 20, 20); 6 border: none; 7 font-weight: 600; 8 display: flex; 9 align-items: center; 10 justify-content: center; 11 box-shadow: 0px 0px 0px 4px rgba(180, 160, 255, 0.253); 12 cursor: pointer; 13 transition-duration: 0.3s; 14 overflow: hidden; 15 position: relative; 16} 17 18.svgIcon { 19 width: 12px; 20 transition-duration: 0.3s; 21} 22 23.svgIcon path { 24 fill: white; 25} 26 27.button:hover { 28 width: 140px; 29 border-radius: 50px; 30 transition-duration: 0.3s; 31 background-color: rgb(181, 160, 255); 32 align-items: center; 33} 34 35.button:hover .svgIcon { 36 /* width: 20px; */ 37 transition-duration: 0.3s; 38 transform: translateY(-200%); 39} 40 41.button::before { 42 position: absolute; 43 bottom: -20px; 44 content: "Back to Top"; 45 color: white; 46 /* transition-duration: .3s; */ 47 font-size: 0px; 48} 49 50.button:hover::before { 51 font-size: 13px; 52 opacity: 1; 53 bottom: unset; 54 /* transform: translateY(-30px); */ 55 transition-duration: 0.3s; 56} 57
303 views
303 views
Comments
3barisdogansutcu 5. December at 10:46
5. December at 10:46
"When used as 'fixed,' there is a width error"
vinodjangid07 Yesterday at 3:49
Yesterday at 3:49
@barisdogansutcu "I tested this button in a project, and after using it as a fixed position and setting the parent element to relative, I didn't encounter any width errors."
barisdogansutcu Yesterday at 9:09
Yesterday at 9:09
@barisdogansutcu can u send me codepen link
MIT License