CSS Flashcards
CSS (38 cards)
What are the three parts of a CSS rule?
Selector, Declaration Block, Declaration
What is a CSS Declaration?
A CSS property followed by a colon (:) and the property value.
What is a CSS Selector?
The HTML elements to which the specific style rule applies.
What is a CSS Declaration Block?
One or more declarations separated by semicolons (;).
Is it a good practice to place each declaration on a separate line and to add a semicolon to the end of each declaration block?
True
What are the valid ways CSS can be implemented?
Embedded, External, Inline
Does an inline style use a selector?
False
Does an inline style use curly braces {}?
False
Should a website use an external stylesheet for styles that apply to all web pages?
True
Can inline styles be used with embedded and external stylesheets?
True
Do CSS style declarations override the default browser style declarations?
True
What is CSS inheritance?
When style declarations from a parent element cascade down and are applied to any child elements.
Can the !important rule be used to override other declarations and disregard specificity?
True
What are the valid CSS selector types?
Class, Descendant, Element, ID, Pseudo-Class
Are class names in HTML separated by commas?
False, they are separated by spaces.
What are some valid pseudo-class selectors?
:empty, :enabled, :hover, :lang(language)
Do pseudo-class selectors match elements based on user behavior or meta-information about HTML elements?
True
What are the different types of CSS selectors and their functions?
Element Selector: Selects HTML elements by name.
Class Selector: Uses . to select elements with a class.
Descendant Selector: Selects elements inside another element.
ID Selector: Uses # to select elements by ID.
Pseudo-Class Selector: Uses : to apply styles based on a state.
What is the universal selector in CSS?
*
What is the term for combining multiple selectors?
Multiple Selector
What is the child selector symbol in CSS?
>
What is the general sibling selector symbol in CSS?
~
What is the adjacent sibling selector symbol in CSS?
+
What are the different CSS combinators?
Adjacent Sibling, Child, Descendant, General Sibling