CSS Flashcards
What are the names of the individual pieces of a CSS rule?
the selector
opening bracket of the declaration block
properties: values;
closing bracket of the declaration block
In CSS, how do you select elements by their class attribute?
You select elements by their class attribute with a .classname
In CSS, how do you select elements by their type?
You select elements by their type by using their name
In CSS, how do you select an element by its id attribute?
You select elements by its ID attribute with a #idName
Name three different types of values you can use to specify colors in CSS
hexcode
RGB(red, green, blue)
color presets
What CSS properties make up the box model?
margins
borders
padding
width and height
the content within the box
Which CSS property pushes boxes away from each other?
The margin property
Which CSS property adds space between a box’s content and its border?
The padding property
If two boxes sit on top of one another, what happens?
The border of the boxes collapse. The margin will be the larger of the two boxes.
What is a pseudo class?
They are classes appended to elements in CSS that makes the elements behave differently when interacted with.
What are CSS pseudo classes useful for?
They’re useful for making a page feel more interactive.
What order must pseudo classes be in?
:link, :visited, :hover, :focus, :active
Name two types of units that can be used to adjust font-size in CSS
rem
pixels (px)
ems
percentages
What CSS property controls the font used for the text inside of an element?
font-family
Which property adds emphasis to text? What two values can it have?
font-weight
normal, bold
Which property can make font either normal, italic, or oblique?
font-style