CSS Flashcards
What are the names of the individual pieces of a CSS rule?
A CSS rule contains two parts: a selector and a declaration.
In CSS, how do you select elements by their class attribute?
With a full stop symbol (a.k.a. A period) then the name/value assigned to the class attribute
In CSS, how do you select elements by their type?
The selector matches the element’s name and is just that
In CSS, how do you select an element by its id attribute?
With a # (pound, hash symbol) then the name/value assigned to the id attribute
Name three different types of values you can use to specify colors in CSS.
RGB Values, HEX Codes, Color Names, HSL Functional Notation
What CSS properties make up the box model?
Margin, padding, border, and the content (content typically referred to in width & height)
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 element(s) (e.g. :link, :visited, :hover,
:focus, :active)
What are CSS pseudo-classes useful for?
They allow you to apply a style/ change the appearance of elements when a user is interacting with them.
Name at least two units of type size in CSS.
Pixels (px), point (pt), percentages (%), ems (em)- equivalent to the size of a letter m)
What CSS property controls the font used for the text inside an element?
The font-family property
What is the default flex-direction of a flex container?
Row is the default flex-direction
What is the default flex-wrap of a flex container?
Nowrap is the default flex-wrap; all flex items will be on one line
Why do two div elements “vertically stack” on one another by default?
Because the grid arranges a box or group of boxes across the page horizontally forming rows. From there, each row can then be divided into one or more columns.