Toggle navigation
☰
Home
HTML
CSS
Scripting
Database
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>3D Pushable Button</title> <style> /* Component: 3D Pushable Button Description: A skeuomorphic-style button that looks like it's being pressed. */ :root { /* Using high contrast colors for the 3D effect */ --push-btn-bg: #f94144; /* Bright red */ --push-btn-bottom-color: #c71f22; /* A darker red for the shadow */ --push-btn-text-color: #ffffff; --push-btn-focus-outline: #f94144; --push-btn-bottom-height: 6px; } .push-container-1 { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; display: flex; justify-content: center; align-items: center; min-height: 250px; background-color: #f0f2f5; } .push-btn-1 { display: inline-block; position: relative; padding: 1rem 2rem; font-size: 1.25rem; font-weight: 700; letter-spacing: 0.5px; color: var(--push-btn-text-color); background-color: var(--push-btn-bg); border: none; border-radius: 12px; cursor: pointer; text-decoration: none; /* The 'bottom' of the button created by box-shadow */ box-shadow: 0 var(--push-btn-bottom-height) 0 0 var(--push-btn-bottom-color); /* The default state has the button slightly pushed down to be 'lifted' on hover */ transform: translateY(2px); transition: transform 0.15s ease, box-shadow 0.15s ease; } .push-btn-1:hover { /* Lifts the button to its 'resting' state before being pressed */ transform: translateY(0); } .push-btn-1:active { /* 'Pushes' the button all the way down */ transform: translateY(var(--push-btn-bottom-height)); box-shadow: 0 0 0 0 var(--push-btn-bottom-color); /* Hides shadow completely when pushed */ } .push-btn-1:focus-visible { outline: 3px solid var(--push-btn-focus-outline); outline-offset: 4px; } </style> </head> <body> <div class="push-container-1"> <button type="button" class="push-btn-1">Launch Game</button> </div> </body> </html>