Advanced CSS Flashcards
What property can be used to add a corner to each corner of a box?
border-radius
Example: border-radius: 20px;
Example: border-radius: 6px 12px 18px 24px;
Example: border-radius: 50px/100px;
How to create an ellipse with CSS?
Specify different horizontal and vertical radii by splitting values with a “/”
Example: border-radius: 50px/100px;
What is the standard CSS property to apply shadows to a box?
box-shadow
Example: box-shadow: 5px 5px 3px 1px #999
What are the possible box-shadow values?
box-shadow: 5px 5px 3px 1px #999
- ) horizontal offset – how far the shadow is nudged to the right (or left if it’s negative)
- ) vertical offset – how far the shadow is nudged downwards (or upwards if it’s negative)
- ) blur radius — the higher the value the less sharp the shadow. (“0” being absolutely sharp).
- ) spread distance — the higher the value, the larger the shadow (“0” being the inherited size of the box)
- ) color
- ) inset - apply shadows to the inside of a box
What is the standard CSS property to apply shadows to text?
text-shadow
Example: text-shadow: -2px 2px 2px #999;
What is the universal selector?
Using an asterisk (“ * ”), you can target everything.
Example: * { } Target everything on a page
Example: #contact * { } Target everything under this ID
What is a universal selector is commonly used for?
The universal selector is commonly used to “reset” many of a browser’s default styles.
What is a child selector?
A greater-than symbol (“>”) can be used to specify something that is a child of something else.
Example: #genus_examples > li { border: 1px solid red }
What is an adjacent selector?
A plus sign (“+”) is used to target an adjacent sibling of an element, essentially, something immediately following something.
Example: h1 + p { font-weight: bold }
What is the general sibling selector?
A general sibling selector uses a tilde (“~”) and will match an element following another regardless of its immediacy.
Example: h1 ~ p { font-weight: bold }
What does HSL stand for?
hue, saturation, and lightness
What is the a in RGBa?
Alpha, as in “alpha transparency”.
This allows you to set the transparency of a box or text.
Example: color: rgba(0,0,0,0.8);
True or False? Anywhere where you can use rgb, you can used rgba.
True
What is Hue, saturation, and lightness?
It gives you direct control over the aspects of a color’s shade rather than its logical ingredients.
Example: color: hsl(36, 100%, 50%)
- ) Hue from 0 to 360 on a color wheel
- ) Saturation from 0% to 100% or grey to full color
- ) Lightness from 0% (black) to 100% (white) 50% (normal)
What is HSLa?
HSLa combines hue, saturation, and lightness with alpha transparency
Example: hsla(0, 75%, 75%, 0.5)