CSS Basics: Styling Your Pages
What CSS Does
Presentation and design
CSS stands for Cascading Style Sheets. It controls how HTML content looks: colors, fonts, spacing, borders, alignment, and layout.
How CSS works
CSS uses selectors to target elements and declarations to set styles. A rule usually looks like a selector followed by a property and value pair.
CSS basics
Start simple
Begin with readable text, comfortable spacing, and clear contrast before adding decorative details.
Common CSS properties
| Property | What it affects |
|---|---|
color | Text color |
background-color | Background color |
font-size | Text size |
margin | Outside spacing |
padding | Inside spacing |
What does CSS mainly control?
CSS is used to style the page.
Correct answer: Page presentation
What is a CSS selector?
It tells the browser what the rule applies to.
Correct answer: A selector is part of a CSS rule that targets which elements to style.
Which property is commonly used to create space outside an element?
Margin creates space outside the element's border.
Correct answer: margin