CSS Flashcards
(31 cards)
What are the names of the individual pieces of a CSS rule?
Selector, declaration block, -> property, value
In CSS, how do you select elements by their class attribute?
dot (.)
In CSS, how do you select elements by their tag name?
name of the element (element selector)
In CSS, how do you select an element by its id attribute?
pound/hashtag (#)
Name three different types of values you can use to specify colors in CSS.
RGB, Hex, Color names, Hue, Saturation (Amount of gray in a color), Brightness (How much black is in a color).
What CSS properties make up the box model?
Border, Margin, and Padding
Which CSS property pushes boxes away from each other?
Margin
Which CSS property add space between a box’s content and its border?
Padding
What is a pseudo-class?
Its a keyword added to a selector
What are CSS pseudo-classes useful for?
It allows the users to have a better interaction/engagement with the browser.
Better functionality
Name two types of units that can be used to adjust font-size in CSS.
px, percentages, rem (changes the width of the letter m)
What CSS property controls the font used for the text inside an element?
Font-family
What is the default flex-direction of a flex container?
Row
What is the default flex-wrap of a flex container?
No wrap (nowrap)
What is the default value for the position property of HTML elements?
Static
How does setting position: relative on an element affect document flow?
No change
How does setting position: relative on an element affect where it appears on the page?
There is no change.
How does setting position: absolute on an element affect document flow?
It acts if it doesn’t exist in the document flow
It won’t have an affect on other elements
How does setting position: absolute on an element affect where it appears on the page?
It appears on the top left
How do you constrain an absolutely positioned element to a containing block?
Any non static position property
What are the four box offset properties?
top, bottom, right, left
What are the four components of “the Cascade”.
specificity, source order, inheritance, and importance.
What does the term “source order” mean with respect to CSS?
When there is styling for an element of the same property, the last one on the stylesheet will be applied.
How is it possible for the styles of an element to be applied to its children as well without an additional CSS rule?
inheritance