Modern Gradient Radio Button - MeggiTools
Run
Toggle Theme
Share Link
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Modern Gradient Radio Button</title> <style> body { display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; background: #e3f2fd; font-family: 'Arial', sans-serif; } .radio-container { display: flex; align-items: center; } .radio-button { appearance: none; width: 40px; height: 40px; border-radius: 50%; background: #ffffff; box-shadow: inset 2px 2px 3px rgba(255, 255, 255, .6), inset -2px -2px 3px rgba(0, 0, 0, .6); border: 2px solid #cfd8dc; outline: none; position: relative; cursor: pointer; transition: all 0.3s ease; background-image: linear-gradient(to top left, rgba(0, 0, 0, .2), rgba(0, 0, 0, .2) 30%, rgba(0, 0, 0, 0)); } .radio-button:checked { background: #b2dfdb; border-color: #80cbc4; box-shadow: inset 2px 2px 3px rgba(255, 255, 255, .4), inset -2px -2px 3px rgba(0, 0, 0, .4); } .radio-button:checked::before { content: ''; position: absolute; top: 50%; left: 50%; width: 18px; height: 18px; border-radius: 50%; background: #004d40; transform: translate(-50%, -50%); } .radio-label { margin-left: 14px; font-size: 18px; color: #000; cursor: pointer; } </style> </head> <body> <div class="radio-container"> <input type="radio" id="modernRadio" name="radio-group" class="radio-button"> <label for="modernRadio" class="radio-label">Option 1</label> <input type="radio" id="modernRadio" name="radio-group" class="radio-button"> <label for="modernRadio" class="radio-label">Option 2</label> <input type="radio" id="modernRadio" name="radio-group" class="radio-button"> <label for="modernRadio" class="radio-label">Option 3</label> </div> </body> </html>