Chapter 3 Quiz Flashcards

1
Q

To further the effort to let HTML be used to define the structure of a document only, and not appearance, what was introduced?

A

Cascading style sheets

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

What is a cascading style sheet?

A

Code that specifies formatting based styles

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

What are three ways to apply CSS?

A

inline style, internal style, and external style

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

What is the simplest way to attach a tag?

A

Using inline styles

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

What is the correct syntax for displaying the level 1 heading “I’m so blue” in blue italics using inline style formatting?

A

h1 style=”color: blue; font-style: italic;” I’m so blue /h1

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

Where are inline styles defined?

A

Within the HTML tag

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

An inline style is created by adding what attribute to an HTML tag?

A

Style attribute

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

A CSS property is separated from its value by what?

A

Colon and a space

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

Multiple CSS property-value pairs are separated from each other by what?

A

Semi-colon and a space

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

What does the span tag do?

A

It allows us to set an inline style for all the content within the tag.

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

What is the drawback of inline styles?

A

They need to be created within each tag, one-time use, difficult to maintain, harder to read, need to be created everywhere and every time it is needed.

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

How are internal styles different from inline styles?

A

Internal styles are defined within the head section of the document and not in each individual tag. Internal styles affect the entire page while inline style only affects the tag it is in.

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

Internal styles are defined within what specific tag in the head section of an HTML document?

A

style

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

If internal styles aren’t defined within an HTML tag, how does the browser know where to apply the style?

A

By the selector.

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

Within the style tag, what is the type attribute set to in all cascading style sheets?

A

text/css

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

What are selectors?

A

Pieces of code that determine what sections of a page are affected by a specific style.

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

After the selector is identified, the property-value pairs are defined and enclosed with what?

A

Curly brackets

18
Q

What types of selectors are available?

A

Element name, element and attributes, classes, Ids, and pseudo-classes.

19
Q

What is the benefit of internal styles?

A

They can be applied through the entire web page, easier to use.

20
Q

What is an element selector?

A

An element name used to specify style for all instances of that element.

21
Q

Can element selectors be grouped, or must they always be defined individually?

A

They can be grouped by separating them with a comma h1, h2, h3

22
Q

What does a contextual selector do?

A

Allows you to specify style under certain conditions. (p a {font-family: Verdana}

23
Q

Regarding selectors, what is a class?

A

A class is a way to create style that is not tied to a specific tag element.

24
Q

How would you identify a class?

A

Dot before the name

25
Q

How do you create a class?

A

Add a class=argument to the opening tag of the element then in the style area, add a style to define the class.

26
Q

In regards to selectors, what is an ID?

A

It is like a class, but more specific.

27
Q

How would you identify an ID?

A

The # before the name.

28
Q

What is the difference between a class and an ID?

A

Classes create styles to more than one type of element or create several different styles for the same element while IDs typically are used only when a specific instance needs a particular style.

29
Q

What is the universal selector and what does it do?

A

It is the asterisk, selects everything and applies that style.

30
Q

What is a pseudo-class?

A

They define special relationships and allow style to be applied. For example, first letter, line, and links.

31
Q

When would you use a pseudo-class?

A

When you want to change the appearance of links or specific text

32
Q

What is an external style sheet?

A

It is a separate file with an extension of .css that contains the style formatting for all files linked to it

33
Q

What is the benefit of an external style sheet?

A

It is a separate file with a .css extension that contains the style formatting for all files linked to it.

34
Q

How would you create an external style sheet?

A

In textEdit, add all the styles that affect the Web pages and save the file with a .css extension.

35
Q

Do external style sheets require the use of selectors?

A

Yes

36
Q

Do external style sheets require the use of the style tag?

A

no

37
Q

How do you apply an external style sheet to a HTML file?

A

Add the link tag to the HTML file.

38
Q

What method of applying CSS would you use if your site were only a page?

A

Internal style

39
Q

What method of applying CSS would you use if your site had more than a page?

A

External style sheet

40
Q

When would you want to use the inline style?

A

To create style for exceptions to the general style information you created in an internal or external style sheet because inline styles always take precedence over internal and external sheets if they overlap.