905 views
CSSAdd prefixes
1.container { 2 --background: linear-gradient(to left, #880505 0%, #f36b11 100%); 3 width: 190px; 4 height: 254px; 5 padding: 4px; 6 border-radius: 5px; 7 overflow: visible; 8 display: flex; 9 align-items: center; 10 background: var(--background); 11 position: relative; 12} 13 14.container .box { 15 position: relative; 16 width: 190px; 17 height: 244px; 18 background: #1b1b1b; 19 display: -webkit-box; 20 display: -ms-flexbox; 21 display: flex; 22 -webkit-box-pack: center; 23 -ms-flex-pack: center; 24 justify-content: center; 25 -webkit-box-align: center; 26 -ms-flex-align: center; 27 align-items: center; 28 border-radius: 10px; 29} 30 31.container .box .content { 32 position: relative; 33 display: -webkit-box; 34 display: -ms-flexbox; 35 display: flex; 36 -webkit-box-pack: center; 37 -ms-flex-pack: center; 38 justify-content: center; 39 -webkit-box-align: center; 40 -ms-flex-align: center; 41 align-items: center; 42 -webkit-box-orient: vertical; 43 -webkit-box-direction: normal; 44 -ms-flex-direction: column; 45 flex-direction: column; 46 text-align: center; 47 gap: 20px; 48 padding: 0 20px; 49 width: 100%; 50 height: 100%; 51 overflow: hidden; 52} 53 54.container .box .content .icon { 55 width: 50px; 56 height: 50px; 57 -webkit-box-shadow: 0 0 0 4px #e6e6e6, 58 0 0 0 6px rgb(212, 10, 10); 59 box-shadow: 0 0 0 4px #e6e6e6, 60 0 0 0 6px rgb(212, 10, 10); 61 display: -webkit-box; 62 display: -ms-flexbox; 63 display: flex; 64 -webkit-box-pack: center; 65 -ms-flex-pack: center; 66 justify-content: center; 67 -webkit-box-align: center; 68 -ms-flex-align: center; 69 align-items: center; 70 font-size: 2.5em; 71 -webkit-transition: 0.5s ease-in-out; 72 transition: 0.5s ease-in-out; 73} 74 75.container .box::before { 76 content: ''; 77 position: absolute; 78 inset: -10px 50px; 79 border-top: 4px solid rgb(99, 89, 247); 80 z-index: -1; 81 border-bottom: 4px solid rgb(65, 44, 250); 82 z-index: -1; 83 z-index: -1; 84 -webkit-transform: skewY(15deg); 85 -ms-transform: skewY(15deg); 86 transform: skewY(15deg); 87 -webkit-transition: 0.5s ease-in-out; 88 transition: 0.5s ease-in-out; 89} 90 91.container .box:hover::before { 92 -webkit-transform: skewY(0deg); 93 -ms-transform: skewY(0deg); 94 transform: skewY(0deg); 95 inset: -10px 40px; 96} 97 98.container .box::after { 99 content: ''; 100 position: absolute; 101 inset: 60px -10px; 102 border-left: 4px solid #880505; 103 z-index: -1; 104 border-right: 4px solid #aa551d; 105 z-index: -1; 106 -webkit-transform: skew(15deg); 107 -ms-transform: skew(15deg); 108 transform: skew(15deg); 109 -webkit-transition: 0.5s ease-in-out; 110 transition: 0.5s ease-in-out; 111} 112 113.container .box:hover::after { 114 -webkit-transform: skew(0deg); 115 -ms-transform: skew(0deg); 116 transform: skew(0deg); 117 inset: 40px -10px; 118} 119 120.container .box .content { 121 border-radius: 50%; 122} 123
HTML
1<div class="container"> 2 <div class="box"> 3 <div class="content"> 4 5 </div> 6 </div> 7</div>