CSS Flashcards
- A _______ is a file that describes how an HTML file should look.
- Style sheets are _______ because the sheets can apply formatting when more than one style applies.
- style sheet
- cascading
What are the two main reasons for separating your form/formatting (CSS) from your functional content/structure (HTML):
1. You can apply the same formatting to several HTML elements without rewriting code (e.g.style=”color:red”:) over and over.
2. You can apply similar appearance and formatting to several HTML pages from a single CSS file.
If you want to write your CSS in the same document as your HTML, place it in the < head> < /head> between _____ tags.
< style> < /style>
- How do you connect an HTML document to it’s CSS file?
- What three attributes does the < link> tag need?
1 Set up a < link> tag in the head.
- type, rel, & href
What does the following tag do?
< link type=”text/css”; rel=”stylesheet”; href=”stylesheet.css”>
Links to a CSS file in an HTML document.
- What is a selector?
- What is a property?
- What is a value?
- Any HTML element, such as < p>, < img>, or < table>. You just take off the < >s.
- An aspect of a selector.
Example: font-family, color, font-size
- A possible setting for a property.
Ex: red
- What is the general format for CSS syntax?
- You need to end each property-value pair with a ___. That’s how CSS knows you’re done with one pair and ready for the next.
- selector { property: value; }
- semicolon (;)
Property-value pairs should always end in a ____ (_)
semi-colon ;
Example:
color: green;
What does a comment in CSS look like?
/* Comments in CSS are helpful for organization */
Font values can be set in pixels ( px ) or ___.
ems
Ex - font-size: 1em;
The font-size unit ___ is a relative measure: _____ is equal to the default font size on whatever screen the user is using. That makes it great for smartphone screens.
ems
1em
How do you create a “box” or container in CSS?
Select div & set property-value pairs for background-color, height, and width.