CSS Flashcards
What are the names of the individual pieces of a CSS rule?
css selector and declaration block (properties and values)
In CSS, how do you select elements by their class attribute?
with a dot and the class name
In CSS, how do you select elements by their type?
with the element’s name
In CSS, how do you select an element by its id attribute?
with the # character
Name three different types of values you can use to specify colors in CSS.
RGB values, hex codes, color names
What CSS properties make up the box model?
margin, padding, border (and content but content is not a property)
Which CSS property pushes boxes away from each other?
margin
Which CSS property adds space between a box’s content and its border?
padding
What is a pseudo-class?
a keyword added to a selector (hover, active, focus, etc) that specifies a special state of the selected element(s)
ex: :hover can be used to change a button’s color when the user’s pointer hovers over it
a keyword that is used to apply a selector to a specific state (certain thing happening in user interaction, history of the navigator– when you click on a link, it turns purple)
a psuedo class is a class apply by a browser to an element in certain situation
What are CSS pseudo-classes useful for?
they let you apply a style to an element when a specified action (such as hovering) occurs
Name at least two units of type size in CSS.
px and rem
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?
nowrap
Why do two div elements “vertically stack” on one another by default?
because div is a block element and it takes up the whole width so the next div has to start on a new line