HTML Flashcards

(124 cards)

1
Q

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

A

In the head element

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

In the body element

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

Where do the and tags go in a valid HTML document?

A

Siblings, children of 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 declaration?

A

To declare the type of the document.

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

HTML, head, title, body, h1

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

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

© for copyrighted symbol

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

They take up the width of the parent element. Push content on the left up and content on the right down.

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

Take up whatever space is needed for the content and doesn’t move any element around.

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

The width and height of the parent

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 and height of whatever space is needed for the content.

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

An ordered list has numbers labeled in ordered pairs while an unordered list has bullet points.

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

What HTML tag is used to link to another website?

A

Anchor

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

What is an absolute URL?

A

A direct address

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

What is a relative URL?

A

Shorthand name for the file within directory.

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 parent directory?

A

../

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 child directory?

A

/

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 a grand parent directory?

A

../../

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

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

A

file name

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

What is the purpose of an HTML form element?

A

To collect info from the user

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

Give five examples of form control elements

A

Select, textarea, form, button, radio

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

Three examples of type attribute values for HTML input elements

A

Text, radio, checkbox

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

Is HTML element a block element or an inline element?

A

Inline block element

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What are the six primary HTML elements for creating tables?
table, thead, tr, td, tbody, th, tfoot
26
What purpose do the thead and tbody elements serve?
thead is for headings while body is for every other content
27
What are the names of the individual pieces of a CSS rule?
rulesets
28
In CSS, how do you select elements by their class attribute?
by placing a period at the start
29
In CSS, how do you select elements by their tag name?
with their tag name
30
In CSS, how do you select an element by its id attribute?
with the pound sign followed by attribute value
31
What CSS properties make up the box model?
border, margin, padding, and content
32
Which CSS property pushes boxes away from each other?
margin
33
Which CSS property add space between a box's content and its border?
padding
34
What is a pseudo class?
Keyword to change an element when it is in a certain state
35
What are the CSS pseudo-classes useful for
help the user with visual feedback
36
Name two types of units that can be used to adjust font-size in CSS.
px and em
37
What CSS property controls the font used for the text inside an element?
font-family
38
what is the default flex-direction of a flex container?
row
39
what is the default flex-wrap of a flex container?
nowrap
40
Why do two div elements "vertically stack" on one another by default?
because they are display:block
41
What is the default value for the position property of HTML elements?
static
42
How does setting position: relative on an element affect document flow?
the. document flow. like the element was never changed.
43
How does setting position: relative on an element affect where it appears on the page?
44
How does setting position: absolute on an element affect document flow?
removes element from document flow
45
How does setting position: absolute on an element affect where it appears on the page?
it is out of the document flow
46
How do you constrain an absolutely positioned element to a containing block?
put it in a nonstatic ancestor
47
What are the four box offset properties?
distances from top bottom left and right
48
What is the default value for the position property of HTML elements?
static
49
How does setting position: relative on an element affect document flow?
the document flow stays the same
50
How does setting position: relative on an element affect where it appears on the page?
it depends on how you choose to position it in relation to it's original position
51
How does setting position: absolute on an element affect document flow?
it takes the element out of the flow
52
How does setting position: absolute on an element affect where it appears on the page?
positions its pixels from the side you set
53
How do you constrain an absolutely positioned element to a containing block?
put it to a non static parent
54
What does it mean to say that variable names are "case sensitive"?
capitalization needs to stay consistent
55
What is the purpose of a string?
To have text that the computer can read
55
What is the purpose of a string?
To have text that the computer can read
56
What is the purpose of a number?
math operations
57
What is the purpose of a boolean?
decision making
58
What characters are allowed in variable names?
letters, numbers not at the start, $, underscores,
59
How do you initialize (assign a value to) a variable?
keyword for variable, variable name, assignment operator, and value
60
How do you declare a variable?
keyword for variable, variable name, assignment operator, and value
61
What does the = operator mean in JavaScript?
assignment operator
62
What is the purpose of variables?
to store values
63
How do you update the value of a variable?
define another variable without keyword
64
What is the difference between null and undefined?
null is a placeholder value, undefined has no value. null has to be defined, it is how a programmer says empty. undefined is how javascript says empty
65
Why is it a good habit to include "labels" when you log values to the browser console?
easier to organize
66
Why is it a good habit to include "labels" when you log values to the browser console?
67
What data type is returned by an arithmetic operation?
numerical value
68
What is string concatenation?
combing two strings together to make a new string
69
What purpose(s) does the + plus operator serve in JavaScript?
to add numbers and concatenate strings
70
What data type is returned by comparing two values (<, >, ===, etc)?
boolean
71
What are objects used for?
to store info in a more flexible way gives you the ability to store multiple pieces of data in one name
72
What are object properties?
variables that part of an object
73
Describe object literal notation.
keyword variable name assignment operator to curly braces, operators are made by a name, colon, then data. properties are separated by commas
74
How do you remove a property from an object?
delete operator
75
What are arrays used for?
to have a list of data
76
Describe array literal notation.
square bracket with values separated by commas
77
How are arrays different from "plain" objects?
index values are different, to add to an object you assign it like a variable, whereas in arrays you have to use the push method.
78
What number represents the first index of an array?
0
79
What is the length property of an array?
gets how many items are in an array
80
How do you calculate the last index of an array?
array length - 1
81
What is a function in JavaScript?
list of steps that can be reused multiple times
82
Describe the parts of a function definition.
function keyword, optional name, parameter list, opening curly brace, code block, closing curly brace
83
Describe the parts of a function call.
function name, followed by parentheses with optional arguments
84
When comparing them side-by-side, what are the differences between a function call and a function definition?
a definition says function and curly brace, while a call only has function name and parenthesis
85
What is the difference between a parameter and an argument?
parameter is a placeholder for the future value, argument is the actual value. parameter is used when you are defining a function while arguments are used when you are calling the function
86
Why are function parameters useful?
create variables within function
87
What two effects does a return statement have on the behavior of a function?
allows the rsult of the function to be used out of the function and exits the function
88
Why do we log things to the console?
to see the state of our code
89
What is a method?
function in an object
90
How is a method different from any other function?
it belongs to an object. prepend it with dot and name of object
91
How do you remove the last element from an array?
pop method
92
How do you round a number down to the nearest integer?
floor method of math object
93
How do you generate a random number?
random method of math object
94
How do you delete an element from an array?
splice method
95
How do you append an element to an array?
push
96
How do you break a string up into an array?
split method
97
Do string methods change the original string? How would you check if you weren't sure?
they do not, and console.log to check
98
Do string methods change the original string? How would you check if you weren't sure?
they do not, and console.log to check
99
Roughly how many string methods are there according to the MDN Web docs?
50
100
Is the return value of a function or method useful in every situation?
no
101
Roughly how many array methods are there according to the MDN Web docs?
a lot
102
What three-letter acronym should you always include in your Google search about a JavaScript method or CSS property?
mdn
103
Give 6 examples of comparison operators.
> < >= <= == ===
104
What data type do comparison expressions evaluate to?
boolean
105
What is the purpose of an if statement?
allows us to make branching decisions
106
Is else required in order to use an if statement?
no
107
Describe the syntax (structure) of an if statement.
if statement, parenthesis, condition, curly braces for code
108
What are the three logical operators?
||, &&, !
109
What is the purpose of a loop?
to repeat an action
110
What is the purpose of a condition expression in a loop?
dictate when the loop stops
111
What does "iteration" mean in the context of loops?
one repetition
112
When does the condition expression of a while loop get evaluated?
before the code block on each iteration
113
When does the initialization expression of a for loop get evaluated?
at the beginning of a loop once
114
When does the condition expression of a for loop get evaluated?
before each loop iteration
115
When does the final expression of a for loop get evaluated?
after the code block is ran
116
Besides a return statement, which exits its entire function block, which keyword exits a loop before its condition expression evaluates to false?
break
117
What does the ++ increment operator do?
increment one
118
What are the four components of "the Cascade".
source order, specificity, and inheritance
119
What does the term "source order" mean with respect to CSS?
the order in which rulesets are declared
120
How is it possible for the styles of an element to be applied to its children as well without an additional CSS rule?
yes, inheritance
121
List the three selector types in order of increasing specificity.
type, class, and id
122
Why is using !important considered bad practice?
strongest way to style, if u use it often it can make your code less flexible
123
what does the transform css property do?
it allows you to rotate, scale, skew or translate an element?