0
0
CSSmarkup~5 mins

CSS syntax and rules - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the basic structure of a CSS rule?
A CSS rule has a selector followed by a declaration block inside curly braces. The declaration block contains one or more property: value; pairs.
Click to reveal answer
beginner
What does a CSS selector do?
A CSS selector chooses which HTML elements the style rules will apply to.
Click to reveal answer
beginner
How do you write a CSS property and value?
Inside the declaration block, write the property name, then a colon, then the value, and end with a semicolon. Example: color: blue;
Click to reveal answer
beginner
Why are semicolons important in CSS declarations?
Semicolons separate each property-value pair. They tell the browser where one declaration ends and the next begins.
Click to reveal answer
beginner
What happens if you forget the closing curly brace in a CSS rule?
The browser may ignore the rule or all following rules, causing styles not to apply correctly. Always close with }.
Click to reveal answer
Which part of a CSS rule selects the HTML elements to style?
ASelector
BProperty
CValue
DDeclaration block
How do you separate multiple CSS declarations inside a rule?
AWith semicolons
BWith colons
CWith commas
DWith periods
What symbol encloses the declarations in a CSS rule?
AParentheses ()
BSquare brackets []
CCurly braces {}
DAngle brackets <>
Which is the correct way to write a CSS declaration for text color blue?
Acolor; blue:
Bcolor = blue;
Ccolor - blue;
Dcolor: blue;
What might happen if you forget the semicolon after a CSS declaration?
AThe browser ignores only that declaration
BThe browser ignores the whole rule or more
CThe browser fixes it automatically
DNothing, it still works fine
Explain the parts of a CSS rule and how they work together to style a webpage.
Think about how you tell the browser what to style and how.
You got /6 concepts.
    Describe common mistakes in CSS syntax and how they affect the appearance of a webpage.
    Consider what happens if the browser can't read your CSS properly.
    You got /4 concepts.