Basics Flashcards
Selector
The beginning of the ruleset used to target the element that will be styled.
Declaration Block
The code in-between (and including) the curly braces ({ }) that contains the CSS declaration(s).
Declaration
The group name for a property and value pair that applies a style to the selected element.
Property
The first part of the declaration that signifies what visual characteristic of the element is to be modified.
Value
The second part of the declaration that signifies the value of the property.
Opening Tag
The start of an HTML element. This is the element that will be styled.
CSS can select HTML elements by ____, ____, ____, and _____.
type, class, ID, and attribute
How can you select all elements?
Using a universal selector *
An element can have different states using what type of selector?
pseudo-class selector e.g) :hover
T or F: Multiple CSS classes can be applied to one HTML element
TRUE
______ can be reusable, while ____ can only be used once.
- Classes
2. IDs
Multiple selectors can be chained together to select an _______.
element. Multiple selectors can be chained together to select an element. This raises the specificity but can be necessary.
Nested elements can be selected by separating selectors with a _____.
space
Multiple unrelated selectors can receive the same styles by separating the selector names with _____.
commas.
Which one is more specific: Classes or IDs?
IDs. IDs will override any styles from a class
Which one is more specific: Classes or Type?
Classes. Classes will override any styles from a type selector
What property defines the typeface of an element?
font-family
What property controls the size of text displayed?
font-size
What property places text in the left, right, or center of its parent container?
text-align
What are the two different attributes that control color?
color and background-color
What property can make an element transparent?
Opacity
What property can set the background of an element to an image?
background-image
What is the flag that will override any style, however it should almost never be used, as it is extremely difficult to override?
!important
What is the content area?
The width and height of the content
What is the box model?
It comprises a set of properties used to create space around and between HTML elements.
Horizontal margins add, so the total space between the borders of adjacent elements is equal to the sum of the right margin of one element and the left margin of the adjacent element.
https://www.youtube.com/watch?v=qKiz9gdJdr8
Vertical margins collapse, so the space between vertically adjacent elements is equal to the larger margin.
https://www.youtube.com/watch?v=qKiz9gdJdr8
margin: 0 auto
horizontally centers an element inside of its parent content area, if it has a width.
The overflow property can be set to…
display, hide, or scroll, and dictates how HTML will render content that overflows its parent’s content area.
The visibility property can
hide or show elements.