CSS Flashcards

1
Q

What are the 3 steps to using CSS with HTML?

A

1) select the element you want to style: p

2) specify the property you want to style:
background-color

3) set the style:
Red

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Each statement in CSS consists of…

A

location

property: style;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Don’t organize each element separately. Try to group together all the common styles between elements. T or F

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you underline text?

A

text-decoration: underline ;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How to make a horizontal line across the page?

A

border: bottom: 1 px solid black ;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you connect to an external style sheet?

A

The “link” element

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which rule is always used?

A

The most specific

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

In general, which styles are inherited?

A

The ones that affect the way your text looks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do you write a comment in CSS?

A

Enclose it between / * and * /

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the two steps to creating a class?

A
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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do you make a CSS rule apply to all members of a class?

A

Leave out the element names and just put a period followed by a class name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you determine the value of an element? Hint: three steps

A

1) do any selectors select it?
2) look at the elements parents (inheritance)
3) use the default value defined by the browser

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

If you have multiple selectors that match this element and define the same property, this is a

A

Conflict

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

If you have a conflict (elements with equal specificity), use the one that comes

A

Last

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Style sheets are what doc type?

A

.css

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How can you check the quality of your CSS?

A

CSS validator

17
Q

Name all the CSS style properties you can

A
top    text-align    letter-spacing    
background-color    color
don't-weight    left   border    
font-style     list-style    padding
line-height   font-size   
background-image
18
Q

What is a rule?

A

A simple statement in CSS consisting of a selector or selectors, along with one or more properties an values

19
Q

What specifies which elements the rule applies to?

A

Selector

20
Q

Property declarations end with a

A

Semi-colon

21
Q

All properties and values go between

A

Braces

22
Q

T or F? You have to use a style sheet to add style to a document.

A

F. You can use the style tag in HTML, however for sites with any complexity, you should link to an external style sheet

23
Q

Inherited properties are passed from parent to

A

Child

24
Q

How do you override inherited properties?

A

Write a more specific rule

25
Q

Use the class attribute to add elements to a

A

Class