Skip to main content

CSS Styling Forms

HTML forms can look far better once styled, and CSS is the tool for that.

Example

Text inputs for first name and last name sit above a country dropdown in this styled form.

Prompt
Create a styled HTML form with fields for First Name, Last Name, and a Country dropdown (Australia, Canada, USA). Style the text inputs with full width, padding, margin, and border. Style the select dropdown similarly.
Output: complete HTML page

Styling Form Input Fields

Most input types accept CSS styling: fields for text or passwords, checkboxes, radio buttons, and also file inputs. Form buttons and input labels can be styled as well.

Input fields commonly get their look from width, padding and margin, from border and border-radius, and from background-color, color and font-size.