Prep CSS Basics Flashcards
What are some characteristics of block?
Displays an element as a block element (like <p>).
Starts on a new line
Takes up the whole width</p>
What are some characteristics of inline?
Displays an element as an inline element (like <span>)</span>
Any height and width properties have NO effect</span>
What are some characteristics of inline-block?
Displays an element as an inline-level block container.
The element itself is formatted as an inline element, but can apply height and width values
Will line up (flow) next to each other left to right.
Describe the syntax of a CSS rule-set.
selector {declaration; declaration}
selector {property:value; property:value;)
ex/
h1 {color: blue; font-size:12px}
What CSS properties make up the box model?
Margin
Border
Padding
Content
Which CSS property pushes boxes away from each other?
Margin
Which CSS property pushes box content away from its border?
Padding
Internal Style Sheet
Child of element
Uses tags
Delete card
External Style Sheet
Uses tag to link to external sheet
External sheet contains code that usually goes btwn tags of internal style sheet
Selectors
Least to most specific
From least specific –> most specific:
Type: <p>
Class: .description
ID: #special</p>
What are these?
Rule set
Selector
Declaration block
Declarations
Ruleset: a chunk of CSS code
Selector: which elements to target
Declaration block: curly braces
Declarations: inside the block (property, colon, and then a value)
Name three different types of values you can use to specify colors in CSS.
color keywords
RGB
Hexadecimal
HSL
What is a pseudo-class?
allows you to select elements based on what state they are in
What are CSS pseudo-classes useful for?
styling elements when user is interacting with them
ex/ hover, active, focus (text cursor), visited (for URLs)
Name two types of units that can be used to adjust font-size in CSS.
px (gives full control)
em (multiplier of default text size 16px)
% (can set default font size of body and combine with em)
vw (viewport width)