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>Icon-Only Buttons</title> <style> /* Component: Icon-Only Buttons Description: A set of accessible, compact buttons for common UI actions. */ :root { --icon-btn-size: 44px; /* A good minimum size for touch targets */ --icon-btn-bg: transparent; --icon-btn-bg-hover: #e9ecef; --icon-btn-icon-color: #495057; --icon-btn-icon-color-danger: #dc3545; --icon-btn-focus-outline: #007bff; } .icon-btn-container-1 { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; display: flex; justify-content: center; align-items: center; gap: 1rem; padding: 2rem; background-color: #f8f9fa; } .icon-btn-1 { display: inline-flex; align-items: center; justify-content: center; width: var(--icon-btn-size); height: var(--icon-btn-size); color: var(--icon-btn-icon-color); background-color: var(--icon-btn-bg); border: none; border-radius: 50%; cursor: pointer; text-decoration: none; transition: background-color 0.15s ease-in-out; } .icon-btn-1 svg { width: 24px; height: 24px; fill: currentColor; } .icon-btn-1:hover { background-color: var(--icon-btn-bg-hover); } /* --- Modifier for a 'danger' action --- */ .icon-btn-1.danger:hover { color: var(--icon-btn-icon-color-danger); background-color: rgba(220, 53, 69, 0.1); } .icon-btn-1:focus-visible { outline: 2px solid var(--icon-btn-focus-outline); outline-offset: 2px; } </style> </head> <body> <div class="icon-btn-container-1"> <!-- Settings Button --> <button type="button" class="icon-btn-1" aria-label="Settings"> <svg aria-hidden="true" height="24" width="24" viewBox="0 0 24 24"><path d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.44,0.17-0.48,0.41L9.22,5.25C8.63,5.5,8.1,5.82,7.6,6.2L5.21,5.24c-0.22-0.08-0.47,0-0.59,0.22L2.7,8.78 C2.58,8.98,2.64,9.25,2.82,9.39l2.03,1.58C4.8,11.36,4.78,11.68,4.78,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.24,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.38,2.44 c0.04,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.48-0.41l0.38-2.44c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.49-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"></path></svg> </button> <!-- Edit Button --> <button type="button" class="icon-btn-1" aria-label="Edit item"> <svg aria-hidden="true" height="24" width="24" viewBox="0 0 24 24"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"></path></svg> </button> <!-- Delete Button --> <button type="button" class="icon-btn-1 danger" aria-label="Delete item"> <svg aria-hidden="true" height="24" width="24" viewBox="0 0 24 24"><path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"></path></svg> </button> </div> </body> </html>