CSS Flashcards
What is CSS?
CSS (which stands forCascadingStyle Sheets) is a language used to describe the appearance and formatting of your HTML.
What is a style sheet?
A file that describes how an HTML file should look.
What does cascading describe?
Cascading means that the sheets can apply formatting when more than one style applies.
Give an example of cascading.
All paragraphs are assigned a blue font, but you specifically single out one paragraph to have a red font.
What code line is necessary in the HTML head that links an HTML page to a stylesheet?
type = "text/css" rel = "stylesheet" href = points to the web address or location of you CSS file on the server.
Give an example of two “self-closing” tags.
<img></img>
Describe the CSS general format.
selector {
property: value;
}
Describe a selector.
Aselectorcan be any HTML element, such as<p>,<img></img>, or. You just take off the<>s! To make a paragraph’s text red with CSS, you’d type:
p {
color: red;
}
Describe a property.
Apropertyis an aspect of a selector. For instance, you can change thefont-family,color, andfont-sizeof the text on your web pages.
Describe a value.
Avalueis a possible setting for a property.colorcan be red, blue, black, or almost any color;font-familycan be a whole bunch of different fonts; and so on.
What is the purpose of a semi-colon at the end of a property-value.
That’s how CSS knows you’re done with one pair and ready for the next.
What is the property for changing the font?
font-family
example: font-family: Arial;
What is the property for changing the color?
color
example: color:blue;
What is the property for changing the font size?
font-size
example: font-size:24px;
How are you able to reset your browsers zoom if it has changed?
Type Command+0 or Ctrl+0 to reset your view.
What is the property for changing the background color?
background-color
example: background-color:yellow;
How do you “comment” in CSS?
/comment/
How does PX (pixel) work in CSS?
A pixel is a dot on your computer screen. Specifying font sizes in pixels is great when you want the user to see exactly on their screen what you designed on yours, though it assumes your screens are of similar size.
Why are EM’s better than PX’s?
Thefont-sizeunitemis arelative measure: one em is equal to the default font size on whatever screen the user is using. That makes it great for smartphone screens, since it doesn’t try to tell the smartphone exactlyhow big to make a font: it just says, “Hey, 1em is the font size that you normally use, so 2em is twice as big and 0.5em is half that size!”
What scripting would you use to use the “backup font” feature in CSS?
font-family:Tahoma, Verdana, sans-serif;
Separate font types by a comma in the order in which they should appear should one type fail.