CSS Flashcards
CSS Syntax
What are the names of the individual pieces of a CSS rule?
Declaration, selector, properties, values
CSS Syntax
In CSS, how do you select elements by their class attribute?
Period symbol(.) and name of class
CSS Syntax
In CSS, how do you select elements by their type?
Name of element
CSS Syntax
In CSS, how do you select an element by its id attribute?
Hash tag (#) and name of id
CSS Colors
Name three different types of values you can use to specify colors in CSS.
RGB Values, HEX Codes, Color Names
CSS Box Model
What CSS properties make up the box model?
width, height, border, margin, padding
CSS Box Model
Which CSS property pushes boxes away from each other?
margin
CSS Box Model
Which CSS property adds space between a box’s content and its border?
padding
CSS Pseudo Classes
What is a pseudo-class?
A CSS pseudo-class is a keyword added to a selector that specifies a special state of the selected element(s).
CSS Pseudo Classes
What are CSS pseudo-classes useful for?
It helps users to interact and know if the object responded to users’ request.
CSS Fonts
Name two types of units that can be used to adjust font-size in CSS.
pixels, ems, percentages, points, inch, rem
CSS Fonts
What CSS property controls the font used for the text inside an element?
font-family
CSS Flexbox
What is the default flex-direction of a flex container?
Row
CSS Flexbox
What is the default flex-wrap of a flex container?
nowrap
CSS Layout Classes
Why do two div elements “vertically stack” on one another by default?
div starts on a new line and has a full-width.
CSS Layout Classes
What is the default flex-direction of an element with display:flex?
Row
CSS-Positioning
What is the default value for the position property of HTML elements?
static
CSS-Positioning
How does setting position: relative on an element affect document flow?
Same spot in flow (nothing change)
CSS-Positioning
How does setting position: relative on an element affect where it appears on the page?
Same exact place
CSS-Positioning
How does setting position: absolute on an element affect document flow?
- The box is taken out of normal flow and no longer affects the position of other elements on the page. (They act like it is not there).
- An absolutely positioned element no longer exists in the normal document flow. Instead, it sits on its own layer separate from everything else.
- Remove from document flow and act as not there (Everything change)
CSS-Positioning
How does setting position: absolute on an element affect where it appears on the page?
Absolute moves strictly to non-static ancestor
CSS-Positioning
How do you constrain an absolutely positioned element to a containing block?
Non-static
CSS-Positioning
What are the four box offset properties?
Top, bottom. left, right
CSS-Cascade
What are the four components of the “Cascade”.
Source, order, inheritance, specificity, !important