CSS Flashcards
What are the names of the individual pieces of a CSS rule?
Ruleset | Declaration block selector { declaration; property: value; }
In CSS, how do you select elements by theirclassattribute?
.class { }
In CSS, how do you select elements by their type?
element { }
In CSS, how do you select an element by itsidattribute?
id { }
Name three different types of values you can use to specify colors in CSS.
RGB values - rgb(100,100,90) - express colors in terms of how much red, green, and blue are used to make up it up, 0 - 255
Hex codes - #ee3e80 - six-digit codes that represent the amount of red, green, and blue in a color, preceded by a #
Color names - 147 predefined color names that are recognized by the browser
RGBA, HSL, HSLA
What CSS properties make up the box model?
Content, 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?
A keyword added to a selector that specifies a special state of the selected elements
Pseudo classes are applied by browsers, not written by developers
:hover, :active, :focus, :visited, :checked
What are CSS pseudo-classes useful for?
Lets you apply a style to an element not only in relation to the content of the document tree, but also in relation to eternal factors like that history of the navigator (:visited), the status of its content (:checked), or the position of the mouse (:hover)
Name two types of units that can be used to adjustfont-sizein CSS.
Pixels - very precise control over how much space their text takes up Percentages - default size of text in browsers is 16px
Ems - is equivalent to the width of a letter m
Rems - based on root 16px
What CSS property controls the font used for the text inside an element?
font-family
What is the defaultflex-directionof aflexcontainer?
flex-direction: row
What is the defaultflex-wrapof aflexcontainer?
flex-wrap: nowrap
Why do two div elements “vertically stack” on one another by default?
div elements are block-level element