Toggle navigation
☰
HTML
CSS
Scripting
Database
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Accessible HTML Form Example</title> <style> body { font-family: sans-serif; margin: 20px; line-height: 1.6; } .form-group { margin-bottom: 15px; } label { display: block; font-weight: bold; margin-bottom: 5px; } input[type="text"], input[type="email"] { padding: 8px; width: 100%; max-width: 300px; border: 1px solid #ccc; border-radius: 4px; } button { padding: 10px 20px; background-color: #0056b3; color: white; border: none; border-radius: 4px; cursor: pointer; } button:hover { background-color: #003d82; } /* Providing clear visual focus states for keyboard users */ input:focus, button:focus { outline: 3px solid #ffbf47; outline-offset: 2px; } </style> </head> <body> <!-- Using semantic elements instead of divs --> <main> <h1>Contact Support</h1> <p>Please fill out the form below. All fields are required.</p> <form action="#" method="post"> <!-- Explicitly linking the label to the input using 'for' and 'id' --> <div class="form-group"> <label for="fullName">Full Name</label> <input type="text" id="fullName" name="fullName" required aria-required="true"> </div> <div class="form-group"> <label for="emailAddress">Email Address</label> <input type="email" id="emailAddress" name="emailAddress" required aria-required="true"> </div> <!-- Using a real button instead of a div painted to look like one --> <button type="submit">Submit Request</button> </form> </main> </body> </html>