CSS Flashcards
What does a h1 {color: black; text-align: center;} tell my computer?
CSS is telling my computer that wherever there is a HTML <h1></h1> tag to color it black and align its text in the center.
What does a p {font-family: “Arial”; font-size: 14px;} tell my computer?
For all the HTML paragraphs <p></p>, let’s use the font family Arial, and let’s make the text 14px.
The primary way to write CSS is to _____ HTML tags.
DESCRIBE
The BIG idea with CSS is that you use it to tell your web browser how to _____ all that HTML you’ve been busy writing.
DISPLAY
CSS selector tells the computer what?
The HTML element it is describing.
Why are the greater-than and less-than HTML brackets <> missing from CSS?
…if they were there, the CSS wouldn’t work!
Each CSS property has two parts:
- NAME
2. VALUE
Each CSS property has its own _____.
LINE
For every HTML element you use, you should create a little bit of _____ to go with it.
CSS
What does CSS stand for?
Cascading Style Sheets
Anatomy of a CSS Block?
HTML tag { property1: value; property2: value; property3: value; }
What are the 3 BASIC levels of styling my HTML text with CSS?
- font-family
- font-size
- color
Web safe fonts are _____ on your browser and cover a lot of _____ fonts like Times New Roman, Arial & Verdana.
PRELOADED
COMMON
What are pixels?
Measurements based on the height of your text as pixels, or one of the tiny dots that make up the image on your screen.
What are EM’s?
Relative text size measurement
What are the 2 ways to designate color with CSS?
- Web Safe Color names
2. Hexadecimal values
Hexadecimal values begin with what?
Hashtag #
How would I change the alignment of my text with CSS?
With TEXT-ALIGN to left, right, center, or justify
How would I italicize text with CSS?
Using FONT-STYLE is oblique or italic
How would I change my HTML text’s weight?
Using FONT-WEIGHT is bold, normal, bolder, lighter, or numbers 100 through 900.
CSS’s TEXT-TRANSFORM allows you to make all your HTML text what?
capitalized, uppercase or lowercase using properties capitalize, uppercase and lowercase.
FONT-VARIANT puts your text into, well, _____-_____ or SMALLER SCREAMING.
SMALL-CAPS
CSS TEXT-DECORATION lets you do what?
add lines over, under and through your text using underline, overline and line-through.
LINE-HEIGHT allows HTML text to have more _____ _____.
BREATHING ROOM
LINE-HEIGHT accepts what values?
pixels, em, numbers, and percentages
CSS TEXT-INDENT allows one to indents at the _____ of your paragraphs,
BEGINNING
What values does CSS TEXT-INDENT take?
pixels, ems, or percentages
WORD-SPACING sets the space between what?
WORDS
What values do WORD-SPACING AND LINE-SPACING accept?
pixels and ems, as well as negative values
How do CSS selectors and HTML tags differ?
CSS selectors are just like HTML opening tags, but without any brackets <>
What is the right way to set the color of my p tags to red?
p{
color: red;
}
What property do I use to make a line through some text?
text-decoration: line-through;
CSS is required to make websites.
False
What are 2 ways to use fancy web safe fonts?
- embed the fonts using the CSS property @font-face
2. Use a service like Google Web fonts or Typekit.
2 steps to add a font to your CSS using the @font-face CSS property?
- Download your font file
2. Save it in a “font” folder inside the folder where your site files are located.
What are the 3 font file type formats one can use?
- OpenType (.otf)
- Embedded OpenType (.eot)
- Web Open Font Format (.woff)
Make sure to always put your @font-face CSS properties at the _____ or close to the _____ of your style.css document.
TOP
TOP
Example of how you might add a Bemio OpenType font (OTF) file to your CSS?
@font-face {
font-family: Bemio;
src: url(‘fonts/Bemio.otf’) format(‘opentype’);
}
Adding a font variant?
@font-face {
font-family: Bemio Italic;
src: url(‘fonts/Bemio-Italic.otf’) format(‘opentype’);
}
Adding an Embedded OpenType font file (EOT)?
@font-face {
font-family: DIN;
src: url(‘fonts/DINRoundWeb.eot’) format (‘eot’);
}
Adding an Web Open Font Format font file (WOFF)?
@font-face {
font-family: DIN;
src: url(‘fonts/DINRoundWeb.woff’) format(‘woff’);
}
Fancy font will not work without what?
Single quotes around the font name.
How do I tell the <em> tag that it needs to use the separate font family of Bemio Italic?</em>
p.fancyfont em {
font-family:’Bemio Italic’;
}
What are the 2 parts of a CSS property?
- Name
2. Value
Computer screens work in what type of color?
RGB
What does RGB stand for?
Red
Green
Blue
The variety of colors you see on your screen right now are produced by _____ that appears through your screen.
light
How are different colors created on a computer screen?
Each pixel is turned on and off to create different colors
RGB is an _____ color model, meaning it mixes colors by light passing through them.
additive
Why do we see different colors when there is only three?
Because the eye blends the colors together due to pixels being so small.
_____ colors are used within the RGB color model to tell your screen what percentage of Red, Green, and Blue to turn on.
Hexadecimal
The _____ symbol signifies that we are defining a hex color.
#
00 means _____ and FF means _____
dark
light
How can one set the color of the entire website?
Use BACKGROUND CSS property for the HTML tag.
The default value for the
CSS background property is _____.
transparent
Does the CSS BACKGROUND property support images as well?
Yes
An example of a CSS BACKGROUND using an image?
div {
background:
url(‘img/my-background.jpg’) repeat 10px 20px white;
}
What are the 2 ways to write a CSS BACKGROUND image?
- Relative URL
2. Hard link
What is a RELATIVE URL?
Reference to where the image is relative to its location in your code files.
What is a HARD LINK?
A regular web link
What does the REPEAT command do for an image?
Repeats it covering the body from left to right, top to bottom.
What are the 4 options for REPEAT image?
- no-repeat
- repeat
- repeat-x
- repeat-y