Module 14: Introduction to CSS

Lesson 5 of 5 · 15–25 minutes

Spacing and borders

🏠The everyday picture

A well-laid-out notice board: space between notices, a margin round the edge, a frame around the important one. Without space, even good content looks cluttered.

📘What it really is

🖱️Try it

Style your contact form: give each field padding: 0.5rem, a border, rounded corners and a margin below it. Make the submit button stand out with your main colour, white text, padding and rounded corners. Add a :focus style so keyboard users can see which field is selected.

✅Quick check

You want more space between the text and the edge of a button. Padding or margin?

Show the answer

Padding, which is the space inside the element.

Why should a focused field look different?

Show the answer

So keyboard users can see where they are on the page.

← PreviousFonts and text
ProLearners Assist