CSS Flashcards
What is the purpose of CSS?
CSS is used to define the styles of web pages, including the design, layout, and variations in display for different devices and screen sizes
Describe the syntax of a CSS rule-set.
A selector for the type (element), class, or ID
Specificity priorities are ID>class>type (element)
A declaration block explaining the rules trying to be applied
Each declaration has a property followed by value(s) and a semi-colon (;)
Cascade (Operations and Priorities)
An element’s descendants will inherit the CSS properties from the rule-set
The last CSS property overwrites earlier CSS properties for the same declarations
Declarations from more specific selectors take priority, regardless of which ones were earlier or later in the code
What CSS properties make up the box model?
The CSS box model is a box that wraps around every HTML element, consisting of margins, borders, padding, and actual content.
Content is where text, images, etc appear
Padding transparently clears an area around the content
Border is what goes around the padding and the content
Margin transparently clears the area outside of the border
Which CSS property pushes boxes away from each other?
Margin
Which CSS property pushes box content away from its border?
Padding
What are some characteristics of block?
Displays an element on a new line and takes up the whole width (like a <p> element)
What are some characteristics of inline?
Displays an element and any height and width properties have no effect
What are some characteristics of inline-block?
Displays an element in-line, but you can apply height and width values
What is the default flex-direction of a flex container?
Row - left to right in ltr and right to left in rtl
What is the default flex-wrap of a flex container?
Nowrap - all flex items will be on one line
What is one of the uses of flexbox?
Providing an efficient way to lay out, align, and distribute space among items in a container, even when their sizes are unknown and/or dynamic.
What are the three primary parts of a layout system?
The Container
An element that acts as the boundary enclosing the other two primary parts - the row(s) and column(s)
Row(s)
One or more elements that are referred horizontally
Column(s)
One or more elements that are referred vertically
What are the names of the individual pieces of a CSS rule?
Ruleset/Rule with first the selector then the declaration(s)
In CSS, how do you select elements by their class attribute?
.class-name
In CSS, how do you select elements by their tag name?
tag-name