Hybrid 4-6 Flashcards

1
Q

T/F - Block elements ignore width and height properties

A

False

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

T/F - All browsers have a default style sheet that apply basic style to HTML markup

A

True

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

An external style sheet uses the ___ file extension

A

css

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

Explain the descendant combinator (“ “)

A

Selects nodes that are descendants of the first element
div h1 { } would match all h1 elements that are nested in a <div> regardless of where that <div> is in the tree

<div>
<ol>
<li> <h1> This would be selected
</h1></li></ol></div>

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

Explain the child combinator (>)

A

Only selects nodes that are direct children of the first element.
div > h1

<div>
<ol>
<li> <h1> This would NOT be selected

<div>
<h1> this would be selected
</h1></div></h1></li></ol></div>

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

Explain the general sibling combinator (~)

A

Selects all subsequent second elements that follow the first element. They must have the same parent.

div ~ h1 All h1 elements, immediate or not, will match ( as long as they have the same parent)

<div>
<ul>
<li> <h1> this will match
<h1> - I don't think this will (div is parent of h1, h1s parent is body)
</h1></h1></li></ul></div>

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

Explain the adjacent sibling combinator (+)

A

2nd element will match only if it immediately follows the first
h2 + p only the first <p> will match

<h2>
<p> match
<p> no match
</p></p></h2>

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

Explain the column combinator (||)

A

Only matches elements matched by the 2nd element that also belong the column elements of the first.

All relates to tables. Essentially you define the columns before actually writing them in HTML. The 2nd element must be part of the columns.

column-selector || td

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

<h1>
<p paragraph 1 p>
<p paragraph 2 p>

CSS
Style
h1 ~ p {
color:red;
}
</Style>

Would the browser output something like this?
Heading
red para
normal para
</h1>

A

No it would not, you would need an adjacent combinator for that. This would look like

Heading
red para
red para

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

Authors use the ____ element to use external style sheets in their HTML pages

A

link

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

.offer

{

color:blue;

font-family:Arial,sans-serif;

}

What does this do?

A

Configures a class called offer with blue text and arial or sans-serif font

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

What is the advantage of using inline CSS?

A

It can be used to quickly test local CSS overrides

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

T/F - Inline elements take up the same height and width as teh content contained within their tags

A

True

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

body {

background: white;

}

section {

background: red;

height:200px

}

What does this do?

A

Red section on a white background

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

What is the universal selector in CSS?

A

*

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

test

What does the # selector do?

A

Selects a single element with the matching id, in this case “test”

17
Q

Can 2 elements have the same id? How about the same name?

A

No, 2 elements cannot have the same id, but they can have the same name

18
Q

What properties are included in the box model?

A

Height, padding, and border

19
Q

What is the root element in HTML?

A

The <html> element, since it is at the start of the branch

20
Q

What is the rem united based on?

A

It’s relative to the font-size of the root element of the page. 1rem = same font size as HTML

21
Q

T/F - Given the following rule
. grid {
display: grid;
width:500px;
grid-template-columns:100px 1fr 1fr;
}
The first column will have a width of 100px. The second column will be 150px wide and the third column will be 300px wide.

A

False. 3 columns, one of them 100px, 2 of them 200px

22
Q

Which of these is a JavaScript Datatype? Which is not?

Int
String
Number
Boolean

A

Number, String, Boolean are, Int is not

23
Q

T/F - JavaScript is used to add interactive content to websites

A

True

24
Q

What would be the result of the JavaScript expression (31 + “angry polar bears”)?

A

31 angry polar bears

25
Q

When a user views a page containing a JavaScript program, which machine executes the script?

A

The users machine running the browser

26
Q

Which equality operator is used to check whether 2 variables are of the same value and type?

A

=== - String equality operator
== Does not check if it’s the same type

27
Q

T/F - JavaScript is a weakly typed language

A

True

28
Q

Strongly typed vs weakly typed

A

Strong: Every variable needs a type, can only receive values of its type

Weak: Vars do not need to be declared with types and the type a value has can change dynamically.

Weak languages see things like conversions/concatenations happen often