HTML Flashcards

(160 cards)

1
Q

Where do you put non-visible content about the HTML document?

A

<head>
</head>

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

Where do you put visible content about the HTML document?

A

<body>
</body>

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

Where do the <head> and <body> tags go in a valid HTML document?

A

Inside <html> element

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

What is the purpose of a <!DOCTYPE> declaration?

A

Tell the browser what version of HTML you’re using.

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

Give five examples of HTML element types.

A

<title>
<head>
<body>
<p>
<img></img>
</p></body></head></title>

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

What is the purpose of HTML attributes?

A

Attributes provide additional information about the contents of an element.

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

Give an example of an HTML entity (escape character).

A

©

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

How do block-level elements affect the document flow?

A

always appear to start on a new line in the browser window.

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

How do inline elements affect the document flow?

A

always appear to continue on the same line as their neighbouring elements.

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

What are the default width and height of a block-level element?

A

Take up full width of the containing block - 100%. Height determined by content - Auto.

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

What are the default width and height of an inline element?

A

width - auto
height - auto

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

What is the difference between an ordered list and an unordered list in HTML?

A

<ol> lists where each item in the list is numbered.
<ul> lists that begin with a bullet point (rather than characters that indicate order).
</ul></ol>

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

Is an HTML list a block element or an inline element?

A

Block

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

What HTML tag is used to link to another website?

A

<a></a>

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

What is an absolute URL?

A

starts with
the domain name for that site, and can be followed by the path to a specific page. If no page is specified, the site will display the homepage.

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

What is a relative URL?

A

link to files within your own files.

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

How do you indicate the relative link to a parent directory?

A

Use ../ to indicate the folder above the current one, then follow it with the file name.

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

How do you indicate the relative link to a child directory?

A

use the name of the child folder, followed by a forward slash, then the file name.

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

How do you indicate the relative link to a grand parent directory?

A

Repeat the ../ to indicate that you want to go up two folders (rather than one), then follow it with the file name.

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

How do you indicate the relative link to the same directory?

A

just use the file name. (Nothing else is needed.)

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

What is the purpose of an HTML form element?

A

refer to different elements that allow you to collect information from visitors to your site.

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

Is an HTML <input></input> element a block element or an inline element?

A

inline

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

What purpose do the thead and tbody elements serve?

A

to show the difference from the first row and the rest of the data in the table

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

What are the names of the individual pieces of a CSS rule?

A

declaration block
property
value
Selector

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
In CSS, how do you select elements by their class attribute?
.selector
25
In CSS, how do you select elements by their tag name?
name of the element
26
In CSS, how do you select an element by its id attribute?
#selector Pound sign Octothorpe
27
What CSS properties make up the box model?
margin padding border height width
28
Which CSS property pushes boxes away from each other?
margin
29
Which CSS property add space between a box's content and its border?
padding
30
What is a pseudo-class?
a class that comes about from a special state on the page.
31
What are CSS pseudo-classes useful for?
user interaction and less work when loading in data.
32
What is the default flex-direction of a flex container?
row
33
What is the default flex-wrap of a flex container?
no wrap
34
Why do two div elements "vertically stack" on one another by default?
because they are block elements
35
What is the default flex-direction of an element with display: flex?
row
36
What are the three primary components of a page layout? (Which helper classes do you need?)
containers rows columns
37
What is the minimum number of columns that you should put in a row?
at least one
38
What is the purpose of a container?
a boundary for content
39
What is the default value for the position property of HTML elements?
it will move relative to where it should exist on the page
40
How does setting position: relative on an element affect document flow?
its removed from the document flow
41
How does setting position: relative on an element affect where it appears on the page?
it appears in where it normally would, or relative to it normal position based on properties set
42
How does setting position: absolute on an element affect document flow?
43
How does setting position: absolute on an element affect where it appears on the page?
appear on the page with in its nearest non static ancestor
44
How do you constrain an absolutely positioned element to a containing block?
set the containing block to position:relative
45
What are the four box offset properties?
top
46
What is the purpose of variables?
to store data for the future
47
How do you declare a variable?
var let const
48
How do you initialize (assign a value to) a variable?
=
49
What characters are allowed in variable names?
letters numbers $ _
50
What does it mean to say that variable names are "case sensitive"?
the same word with different capitalization will not be the same variable
51
What is the purpose of a string?
to hold text
52
What is the purpose of a number?
math
53
What is the purpose of a boolean?
if a state is true or false
54
What does the = operator mean in JavaScript?
assigns a value
55
How do you update the value of a variable?
name of variable = value
56
What is the difference between null and undefined?
null is intentionally empty undefined usually means something i missing
57
Why is it a good habit to include "labels" when you log values to the browser console?
without it just prints a value with out context
58
What data type is returned by an arithmetic operation?
a number
59
What is string concatenation?
combining strings
60
What purpose(s) does the + plus operator serve in JavaScript?
addition or concatenation
61
What data type is returned by comparing two values (<, >, ===, etc)?
boolean
62
What does the += "plus-equals" operator do?
adds or concatenate and assigns
63
What are objects used for?
to store like data
64
What are object properties?
65
How do you remove a property from an object?
66
What are the two ways to get or update the value of a property?
.notation [] notation
67
What are arrays used for?
lists of things in order
68
How are arrays different from "plain" objects?
they are in order
69
What number represents the first index of an array?
[0]
70
What is the length property of an array?
.length
71
Why do we log things to the console?
to see what our code is doing while its running
72
What is a method?
function that is stored withing a object
73
How is a method different from any other function?
a function attached to an object
74
How do you remove the last element from an array?
.pop()
75
How do you round a number down to the nearest integer?
Math.floor()
76
How do you generate a random number?
Math.random()
77
How do you delete an element from an array?
.splice()
78
How do you append an element to an array?
.push()
79
How do you break a string up into an array?
.split()
80
Do string methods change the original string? How would you check if you weren't sure?
no strings are immutable. try it or console.log
81
Is the return value of a function or method useful in every situation?
No
82
What three-letter acronym should you always include in your Google search about a JavaScript method or CSS property?
MDN
83
What is the purpose of a loop?
repeat a code block until a condition is no longer met
84
What is the purpose of a condition expression in a loop?
tells the loop when to stop
85
What is the purpose of a condition expression in a loop?
tells the loop when to stop
86
What does "iteration" mean in the context of loops?
how many times the code block ran
87
When does the condition expression of a while loop get evaluated?
at the beginnning of each iteration of the loop
88
When does the initialization expression of a for loop get evaluated?
only once
89
When does the condition expression of a for loop get evaluated?
before each iteration of the code block
90
When does the final expression of a for loop get evaluated?
at the end of each iteration of the loop
91
Besides a return statement, which exits its entire function block, which keyword exits a loop before its condition expression evaluates to false?
break
92
What does the ++ increment operator do?
increments value by 1
93
How do you iterate through the keys of an object?
for in loop
94
What are the four components of "the Cascade".
source order inheritance specificity !important
95
What does the term "source order" mean with respect to CSS?
the order the rules appear in the actual stylesheet
96
How is it possible for the styles of an element to be applied to its children as well without an additional CSS rule?
inherit
97
Why is using !important considered bad practice?
it overrides all other rules
98
Why do we log things to the console?
verify data is there
99
What is a "model"?
a representation or recreation of something
100
Which "document" is being referred to in the phrase Document Object Model?
the html document
101
What is the word "object" referring to in the phrase Document Object Model?
data
102
What is a DOM Tree?
the tree
103
Why might you want to assign the return value of a DOM query to a variable?
so you dont have query the entire document every time
104
What console method allows you to inspect the properties of a DOM element object?
console.dir()
105
Why would a