Give #input 8px padding and a 1px solid #cccccc border.
Acceptance criteria
- 1.Give #input 8px padding and a 1px solid #cccccc border.
CSS Tutorial · CSS Lists, Tables & Forms
These 10 tasks go with the CSS Form Styling chapter. 5 of them ask you to build something small from scratch; 5 give you code that is already broken and ask you to work out why. Set aside about 90 minutes for the whole set, though you can do them in any order.
Nothing here is marked by a person. When you press Submit, the editor checks your code against the points listed under each task and tells you straight away what passed and what didn't (you need a free account to submit). If you get stuck, there are hints, and a worked solution once you've had a go. The first 2 tasks are free; the rest are part of the practice plan.
If it's been a while since you read the chapter, here is how it starts: “The CSS Form Styling properties are used to improve the appearance of HTML forms and their elements.” Read the chapter.
1.Style the inputexercise · easy · 10 min
Give #input 8px padding and a 1px solid #cccccc border.
Passes when: Give #input 8px padding and a 1px solid #cccccc border.
2.Style the buttonexercise · easy · 10 min · practice plan
Give #btn a navy background and white text.
Passes when: Give #btn a navy background and white text.
3.Stack the labelexercise · easy · 10 min · practice plan
Put #label on its own line.
Passes when: Put #label on its own line.
4.Limit the textarea resizeexercise · easy · 10 min · practice plan
Let #area resize vertically only.
Passes when: Let #area resize vertically only.
5.Lay out the formexercise · medium · 10 min · practice plan
Stack the fields in a column with a 12px gap.
Passes when: Stack the fields in a column with a 12px gap.
6.Fix the border with no stylebug fix · easy · 8 min
A border needs a style to be drawn.
Passes when: A border needs a style to be drawn.
7.Fix the swapped coloursbug fix · easy · 8 min · practice plan
The button should be navy with white text.
Passes when: The button should be navy with white text.
8.Fix the inline labelbug fix · easy · 8 min · practice plan
A label on its own line needs display: block.
Passes when: A label on its own line needs display: block.
9.Fix the resize valuebug fix · easy · 8 min · practice plan
Vertical-only resizing uses the value vertical.
Passes when: Vertical-only resizing uses the value vertical.
10.Fix the row layoutbug fix · easy · 8 min · practice plan
The fields should stack in a column.
Passes when: The fields should stack in a column.
Between them these tasks cover Styling inputs and buttons, Label layout and Form layout.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.