Can you describe CSS syntax?
Experience Level:
Junior
Tags:
CSS
Answer
The CSS rule-set consists of the 2 building blocks:
- selector
- declaration
selector {
property-name: property-value;
property-name2: property-value2;
}
- The selector is responsible for defining which elements the CSS styles will be applied onto.
- The declaration defines list of semicolon-delimited CSS properties.
- Each CSS property consists of property name and value where property name is delimited from value by colon.
Related CSS job interview questions
-
How can we group selectors?
CSS Junior -
What is a selector and what selector types do you know?
CSS Junior -
What problem does CSS solve?
CSS Junior -
Why use CSS?
CSS Junior -
What is CSS and what is it used for?
CSS Junior