CSS Flashcards
What are the names of the individual pieces of a CSS rule?
Selector, declaration, property, value
In CSS, how do you select elements by theirclassattribute?
Period, class name
In CSS, how do you select elements by their type?
Element name
In CSS, how do you select an element by itsidattribute?
Hashtag, class name
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?
Width, height, padding, border, margin
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?
Keyword added to a selector that specifies a special state of the selected element
What are CSS pseudo-classes useful for?
Applying a style to an element in relation to the content of the document tree and to external factors i.e. history of navigator, status of content or position of mouse
Name two types of units that can be used to adjust font-size in CSS
Pixels, EMs, 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
What is the default flex-wrap of a flex container?
Nowrap
Why do two div elements “vertically stack” on one another by default?
Div is a block element with a default width of 100%, placing another div naturally goes under the other to take up its’ own width of 100%
What is the defaultflex-directionof an element withdisplay: flex?
Row
What is thedefaultvalue for thepositionproperty of HTML elements?
Static
How does settingposition: relativeon an element affect document flow?
Does not change document flow
How does setting position: relative on an element affect where it appears on the page?
Stays in the same spot
How does settingposition: absoluteon an element affect document flow?
Takes the element out of document flow
How does settingposition: absoluteon an element affect where it appears on the page?
Sits in the top left corner of its ancestor element
How do you constrain an absolutely positioned element to a containing block?
Setting a containing blocks position to anything but static
What are the four box offset properties?
Top, left, bottom, right
What does the transform property do?
Lets you rotate, scale, skew, or translate an element.
Give four examples of CSS transform functions
Matrix, translate, scale, rotate, skew
Thetransitionproperty is shorthand for which four CSS properties?
transition-property, transition-duration, transition-timing-function, and transition-delay
Give two examples of media features that you can query in an@mediarule.
Width and height
What is abreakpointin responsive Web design?
The “point” at which a website’s content and design will adapt in a certain way in order to provide the best possible user experience
What is the advantage of using a percentage (e.g.50%)widthinstead of a fixed (e.g.px)widthfor a “column” class in a responsive layout?
The width is based on the percentage of its’ parent element
If you introduce CSS rules for a smallermin-widthafterthe styles for a largermin-widthin your style sheet, the CSS rules for thesmallermin-widthwill “win”. Why is that?
Source order