CSS Flashcards
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?
starts with . followed by name
In CSS, how do you select elements by their type?
the name of the element
What is the advantage of using a percentage (e.g. 50%) width instead of a fixed (e.g. px) width for a “column” class in a responsive layout?
Percentages move with the width so it scales as it changes creating more visual appeal
In CSS, how do you select an element by its id attribute?
by # followed by name
What CSS properties make up the box model?
border margin, padding, and content
Which CSS property pushes boxes away from each other?
margin
Which CSS property add space between a box’s content and its border?
padding
Which CSS property add space between a box’s content and its border?
padding
Name three different types of values you can use to specify colors in CSS
hsl, rgb, and hex colors
What is a pseudo-class?
keyword added to a selector that specifies a special state of the selected element(s)
What are CSS pseudo-classes useful for?
Event based styling, (such as user interaction) focus, hover, visited,
based on position with sibling elements
Name at least two units of type size in CSS.
px, , rem, (adaptive uses percentages)
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