CSS Flashcards
What are the 3 steps to using CSS with HTML?
1) select the element you want to style: p
2) specify the property you want to style:
background-color
3) set the style:
Red
Each statement in CSS consists of…
location
property: style;
Don’t organize each element separately. Try to group together all the common styles between elements. T or F
True
How do you underline text?
text-decoration: underline ;
How to make a horizontal line across the page?
border: bottom: 1 px solid black ;
How do you connect to an external style sheet?
The “link” element
Which rule is always used?
The most specific
In general, which styles are inherited?
The ones that affect the way your text looks
How do you write a comment in CSS?
Enclose it between / * and * /
What are the two steps to creating a class?
1) add the element to the class by adding a class attribute to the element in the HTML i.e. < p class =" green tea " > 2) select that class in the CSS i.e. p . greentea { color: green ; }
How do you make a CSS rule apply to all members of a class?
Leave out the element names and just put a period followed by a class name
How do you determine the value of an element? Hint: three steps
1) do any selectors select it?
2) look at the elements parents (inheritance)
3) use the default value defined by the browser
If you have multiple selectors that match this element and define the same property, this is a
Conflict
If you have a conflict (elements with equal specificity), use the one that comes
Last
Style sheets are what doc type?
.css