|
| 1 | +button{ |
| 2 | + display: block; |
| 3 | + margin: 100px auto; |
| 4 | +} |
| 5 | + |
| 6 | +button:hover { |
| 7 | + cursor: pointer; |
| 8 | +} |
| 9 | + |
| 10 | +.button-3d-1 { |
| 11 | + position: relative; |
| 12 | + background: orangered; |
| 13 | + border: none; |
| 14 | + color: white; |
| 15 | + padding: 15px 24px; |
| 16 | + font-size: 1.4rem; |
| 17 | + /* hsl(hue, saturation, lightness) */ |
| 18 | + box-shadow: -6px 6px 0 hsl(16, 100%, 30%); |
| 19 | + outline: none; |
| 20 | +} |
| 21 | + |
| 22 | +.button-3d-1:hover { |
| 23 | + background: hsl(16, 100%, 45%); |
| 24 | +} |
| 25 | + |
| 26 | +.button-3d-1:active { |
| 27 | + background: hsl(16, 100%, 40%); |
| 28 | + top: 3px; |
| 29 | + left: -3px; |
| 30 | + box-shadow: -3px 3px 0 hsl(16, 100%, 30%); |
| 31 | +} |
| 32 | + |
| 33 | +.button-3d-1::before { |
| 34 | + position: absolute; |
| 35 | + display: block; |
| 36 | + content: ""; |
| 37 | + height: 0; |
| 38 | + width: 0; |
| 39 | + |
| 40 | + border: 6px solid transparent; |
| 41 | + border-right: 6px solid hsl(16, 100%, 30%); |
| 42 | + border-left-width: 0px; |
| 43 | + top: 0; |
| 44 | + left: -6px; |
| 45 | +} |
| 46 | + |
| 47 | +.button-3d-1::after { |
| 48 | + position: absolute; |
| 49 | + display: block; |
| 50 | + content: ""; |
| 51 | + height: 0; |
| 52 | + width: 0; |
| 53 | + |
| 54 | + border: 6px solid transparent; |
| 55 | + border-top: 6px solid hsl(16, 100%, 30%); |
| 56 | + border-bottom-width: 0px; |
| 57 | + bottom: -6px; |
| 58 | + right: 0; |
| 59 | +} |
| 60 | + |
| 61 | +.button-3d-1:active::before { |
| 62 | + border: 3px solid transparent; |
| 63 | + border-right: 3px solid hsl(16, 100%, 30%); |
| 64 | + border-left-width: 0px; |
| 65 | + left: -3px; |
| 66 | +} |
| 67 | + |
| 68 | +.button-3d-1:active::after { |
| 69 | + border: 3px solid transparent; |
| 70 | + border-top: 3px solid hsl(16, 100%, 30%); |
| 71 | + border-bottom-width: 0px; |
| 72 | + bottom: -3px; |
| 73 | +} |
0 commit comments