Chapter 10: Introducing CSS Flashcards

(18 cards)

1
Q

CSS works by associating ____ with HTML elements which govern how content of specified elements should be displayed

A

rules

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

A CSS rule contains two parts: a ____ and a _____

A

selection, declaration

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

p {
font-family: Arial;}

A

p is the selecto, the rest is the declaration

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

CSS declaration sit inside curly brackets and each is made up of two parts, a ____ and a _____ separated by _____

A

property, value, colon

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

The ____ element can be used in an HTML document to tell the browser where to find the CSS file used to style the page

A

<link></link>

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

This specifies the path the to CSS file

A

href

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

This attirbute specifies the type of document being linked to

A

type

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

This epcifies the relationship between the HTML page and the file it is linked to

A

rel

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

You can also include CSS rules within an HTML page by placing them inside _____ element which usually sits inside the _____ element of the page

A

<style>

, <head>
</style>
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Universal selector

A

Applies to all elements in the document
Ex: *{}

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

Type Selector

A

Matches element Names
h1, h2, h3 {}
Targets the <h1>, <h2> and <h3>
elements

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

Class Selector

A

Matches an element whose
class attribute has a value that
matches the one specified after
the period (or full stop) symbol

.note {}
Targets any element whose class
attribute has a value of note
p.note {}
Targets only <p> elements
whose class attribute has a
value of note

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

ID Selector

A

introduction {}

Matches an element whose
id attribute has a value that
matches the one specified after
the pound or hash symbol

Targets the element whose
id attribute has a value of
introduction

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

Child Selector

A

Matches an element that is adirect child of another

li>a {}
Targets any <a> elements that
are children of an <li> element
(but not other <a> elements in
the page)</a></a>

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

Descendant Selector

A

Matches an element that is a descendent of another specified element (not just a direct child of that element)

p a {}
Targets any <a> elements that
sit inside a <p> element, even if
there are other elements nested
between them</a>

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

Adjacent Sibling
Selector

A

Matches an element that is the next sibling of another

h1+p {}
Targets the first <p> element
after any <h1> element (but not
other <p> elements)

17
Q

General Sibling
Selector

A

Matches an element that is a sibling of another, although it does not have to be the directly preceding element

h1~p {}
If you had two <p> elements that
are siblings of an <h1> element,
this rule would apply to both