CSS Properties And Values Flashcards
You want to underline text and make it red
Text-decoration : underline red ;
OR
Border-bottom : 2px solid red ;
Why is border - bottom a good way to do underlining?
More control. You can use padding to push away the underlining.
Change color of text?
Color: ___
Two groups of properties to change texts
Font
Text
Font - family : “ Helvetica Neue” , helvetica, Arial;
Why is helvetica Neue in quotation marks and not the others?
Any font family with 2+ words need quotation marks.
What property to italicize a font? What other values in this property group?
Font - style : italic (oblique, normal, inherit)
What declaration to make all texts capitalized but small? (What other values in this property?
Font - variant : small - caps (normal, inherit)
How to change thickness of font?
Font - weight : bold (or normal, bolder, lighter, inherit)
Font weights start at 100, 200, 300, up to 900. Which number is normal thickness? Which is bold? When can we use them?
Normal = 400 Bold = 700
Only can use if typeface comes in those weights.
How to control spacing between lines of text? What is the normal spacing value?
Line - height : ___ px ;
Normal = 150% or 1.5
You have a box or button with a text in it. How to vertically center that text?
Height : 22px ;
Line - height : 22 px ;
Make height & line height the same value.
When writing shorthand for font properties, what do the letters mean below:
Font: A B C D / E F, F, F ;
Which letters are required? Why the / and the commas?
A = font - style B = Font - variant C = Font - weight D = font - size E = line - height F = all font family options
Only D & E are required. ? Separates them. Commas separate font families.
What’s a CSS pseudo-class. Ex?
Add to end of a selector to style an element in SPECIFIC CONDITIONS
Ex. Hover = content changes style when you hover over it.
You want to change the style of an element when you float your mouse over it. How?
Type : hover after your selector + your style rules
You want your text to be all the way right, or left, or centered… what property? What other values in this property group?
Text - align : left, center, right, justify, inherit.
Text align left vs float left?
Text align = moves text inside element
Float = moves ENTIRE ELEMENT
What property to underline your text? What other values are in this property group?
Text - decoration: underline, none, overline, line - through, inherit.
How to code MULTIPLE text decorations in the same element?
Separate with a space
How to indent text? What property?
Text - indent :
Text - indent : 20px
Vs
Text - indent : - 20px
20 px = indents inward (to the right)
- 20 px = opposite direction
How to make a shadow for your text? What property? What values?
Text - shadow : A B C D
A = horizontal distance B = Vertical distance C = blur radius D = color
You want to put a shadow on your text that goes down 10 px and to the right 5 pixels . It will be a little blurry, and have an rgba of 2, 3, 9, .5. How to code?
Text - shadow : 5px 10px 3px rgba(2, 3, 9, .5) ;
How to change space between letters of a text?
Letter - spacing :
What does letter - spacing : relative ; mean?
Relative = keeps correct space between letters even as font-size changes
How to control space between text words? What property?
Word - spacing : __ ;
What are web-safe fonts?
Every gadget and computer has these fonts installed in them. 100% guarantee they will work if you use them.
How do you use fonts that you created by yourself?
You can embed them into your CSS with @ font - face selector
Make background of element a different color
Background - color : ____ ;
How to code a backup background color or property in your CSS? Give example
Write the backup above the first choice:
Div {
_ background - color : backup value (choose most accessible option)
_ background - color : first choice
}
What color values aren’t supported by all browsers?
Rgba and HSLa