Toggle navigation
☰
Home
HTML
CSS
Scripting
Database
<!DOCTYPE html> <title>My Example</title> <!-- Place the following CSS in your <head> or stylesheet --> <style> /* This is an optional body style to provide a background for the page */ body { background-color: #f3f4f6; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif; } /* Container for the user list */ .user-list-container { max-width: 800px; margin: 2rem auto; display: grid; gap: 1rem; } /* === User Role Management Card Styles === */ .urm-card { --urm-radius: 12px; --urm-shadow: 0 4px 10px rgba(0,0,0,0.06); background-color: #ffffff; border-radius: var(--urm-radius); box-shadow: var(--urm-shadow); display: flex; align-items: center; gap: 1.5rem; padding: 1.5rem; } .urm-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; } .urm-user-details { flex-grow: 1; line-height: 1.4; } .urm-user-name { font-size: 1.125rem; font-weight: 600; margin: 0; } .urm-user-email { font-size: 0.95rem; color: #6b7280; margin: 0.25rem 0 0; } /* Role select and actions */ .urm-controls { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; } .urm-role-select { font-size: 0.9rem; padding: 0.5rem 2rem 0.5rem 0.75rem; border: 1px solid #d1d5db; border-radius: 8px; background-color: #ffffff; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e"); background-position: right 0.5rem center; background-repeat: no-repeat; background-size: 1.25em; -webkit-appearance: none; -moz-appearance: none; appearance: none; cursor: pointer; } .urm-remove-btn { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; background: none; border: none; padding: 0; cursor: pointer; color: #9ca3af; transition: color 0.2s ease, background-color 0.2s ease; border-radius: 50%; } .urm-remove-btn:hover { color: #ef4444; background-color: #fef2f2; } .urm-remove-btn svg { width: 20px; height: 20px; } @media (max-width: 600px) { .urm-card { flex-direction: column; align-items: flex-start; } .urm-controls { width: 100%; justify-content: space-between; margin-top: 1rem; } .urm-role-select { flex-grow: 1; } } </style> <!-- Place the following HTML in your <body> --> <div class="user-list-container"> <!-- User 1 --> <article class="urm-card"> <img src="https://placehold.co/128x128/6366f1/ffffff/png?text=AZ" alt="Avatar of Adelaide Vance" class="urm-avatar"> <div class="urm-user-details"> <h3 class="urm-user-name">Adelaide Vance</h3> <p class="urm-user-email">adelaide.vance@example.com</p> </div> <div class="urm-controls"> <label for="role-1" class="visually-hidden">User Role</label> <select class="urm-role-select" id="role-1"> <option value="admin">Admin</option> <option value="editor" selected>Editor</option> <option value="viewer">Viewer</option> </select> <button class="urm-remove-btn" type="button" aria-label="Remove user"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"><path d="M10 11V17" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> <path d="M14 11V17" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> <path d="M4 7H20" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> <path d="M6 7H12H18V18C18 19.6569 16.6569 21 15 21H9C7.34315 21 6 19.6569 6 18V7Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> <path d="M9 5C9 3.89543 9.89543 3 11 3H13C14.1046 3 15 3.89543 15 5V7H9V5Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg> </button> </div> </article> <!-- User 2 --> <article class="urm-card"> <img src="https://placehold.co/128x128/ec4899/ffffff/png?text=E" alt="Avatar of Elara Vance" class="urm-avatar"> <div class="urm-user-details"> <h3 class="urm-user-name">Elara Vance</h3> <p class="urm-user-email">elara.vance@example.com</p> </div> <div class="urm-controls"> <label for="role-2" class="visually-hidden">User Role</label> <select class="urm-role-select" id="role-2"> <option value="admin">Admin</option> <option value="editor">Editor</option> <option value="viewer" selected>Viewer</option> </select> <button class="urm-remove-btn" type="button" aria-label="Remove user"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"><path d="M10 11V17" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> <path d="M14 11V17" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> <path d="M4 7H20" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> <path d="M6 7H12H18V18C18 19.6569 16.6569 21 15 21H9C7.34315 21 6 19.6569 6 18V7Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> <path d="M9 5C9 3.89543 9.89543 3 11 3H13C14.1046 3 15 3.89543 15 5V7H9V5Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg> </button> </div> </article> </div>