|
| 1 | +@import url("https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400..700;1,400..700&display=swap"); |
| 2 | + |
| 3 | +*, |
| 4 | +::before, |
| 5 | +::after { |
| 6 | + margin: 0; |
| 7 | + padding: 0; |
| 8 | + box-sizing: border-box; |
| 9 | + font-family: "Lora", serif; |
| 10 | +} |
| 11 | + |
| 12 | +body { |
| 13 | + display: flex; |
| 14 | + flex-direction: column; |
| 15 | + align-items: center; |
| 16 | +} |
| 17 | + |
| 18 | +header { |
| 19 | + margin: 20px 0; |
| 20 | +} |
| 21 | + |
| 22 | +img { |
| 23 | + width: 200; |
| 24 | + height: 200px; |
| 25 | +} |
| 26 | + |
| 27 | +.images { |
| 28 | + display: grid; |
| 29 | + grid-template-columns: repeat(2, 1fr); |
| 30 | + gap: 20px; |
| 31 | +} |
| 32 | + |
| 33 | +h3 { |
| 34 | + text-align: center; |
| 35 | + margin-bottom: 20px; |
| 36 | +} |
| 37 | + |
| 38 | +figcaption { |
| 39 | + text-align: center; |
| 40 | +} |
| 41 | + |
| 42 | +input[type="range"] { |
| 43 | + -webkit-appearance: none; |
| 44 | + appearance: none; /* By giving it the value of none this tells each respective browser to clear out any default styles. |
| 45 | + This removes track: this is the part of the horizontal slider that the circular thumb runs along */ |
| 46 | + background: transparent; |
| 47 | + cursor: pointer; |
| 48 | + width: 15rem; |
| 49 | + background: #053a5f; |
| 50 | + height: 0.5rem; |
| 51 | + border-radius: 0.5rem; |
| 52 | +} |
| 53 | + |
| 54 | +/* webkit targets Chrome, Safari, Opera and Edge (post-Chromium) browsers */ |
| 55 | +input[type="range"]::-webkit-slider-thumb { |
| 56 | + -webkit-appearance: none; |
| 57 | + appearance: none; |
| 58 | + width: 1rem; |
| 59 | + height: 2rem; |
| 60 | + background-color: cyan; |
| 61 | +} |
| 62 | + |
| 63 | +/* -moz target firefox browser */ |
| 64 | +input[type="range"]::-moz-range-thumb { |
| 65 | + -moz-appearance: none; |
| 66 | + appearance: none; |
| 67 | + width: 1rem; |
| 68 | + background-color: cyan; |
| 69 | + height: 2rem; |
| 70 | + /* Default border-radius and grey border that it applies to the thumb, we need to remove that */ |
| 71 | + border: none; |
| 72 | + border-radius: initial; |
| 73 | +} |
| 74 | + |
| 75 | +/* Removes default focus that gets track on the range slider */ |
| 76 | +input[type="range"]:focus { |
| 77 | + outline: none; |
| 78 | +} |
| 79 | + |
| 80 | +input[type="range"]:focus::-webkit-slider-thumb { |
| 81 | + border: 1px solid #053a5f; |
| 82 | + outline: 2px solid #053a5f; |
| 83 | + outline-offset: 2px; |
| 84 | +} |
| 85 | + |
| 86 | +input[type="range"]:focus::-moz-range-thumb { |
| 87 | + border: 1px solid #053a5f; /* We need add our custom border */ |
| 88 | + outline: 2px solid #053a5f; |
| 89 | + outline-offset: 2px; |
| 90 | +} |
0 commit comments