HTML Flashcards

1
Q

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

A

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

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

within the html tags

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

declare the version of HTML being used

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

Give 5 examples of HTML element tags.

A

p, head, body, html, span

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

They give us more information about the 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

&reg

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 start a new line

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

they are on the same line

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
width = 100% (of container)
height = 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

both 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 and unordered list in HTML?

A

ordered are numbered, unordered are not

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

Is an HTML list a block or 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 tag (a)

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

What is an absolute URL?

A

external navigation, nav to another site

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

What is a relative URL?

A

internal navigation, nav within your site

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

../parent

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

child/wherever

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

../../grand parent

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

just type name of desired file

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

Collect user input/information

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

input, text area, select, option, button

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

Give three examples of type attributes for HTML input elements.

A

submit, file, radio, checkbox, password, text

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

Is an HTML input element a block or inline element?

A

inline

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

What are the 6 primary HTML elements for creating tables?

A

table, thead, tbody, tr, td, tfoot

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

What purpose do the thead and tbody elements serve?

A

organizational purpose

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

Give two examples of data that would lend itself well to being displayed in a table.

A

sport scores, grades, any tabular data

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

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

A

selector, declaration block, property, value

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

In CSS, how do you select elements by their class attribute

A

.classname

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

In CSS, how do you select elements by their type?

A

type name

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

In CSS, how do you select an element by its id attribute?

A

idname

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

Name three different types of values you can use to specify colors in CSS.

A

hex code, RGB, color name, RGBA, HSL (hue saturation and luminosity), HSLA

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

What CSS properties make up the box model?

A

border, padding, margin

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

Which CSS property pushes boxes away from eachother?

A

margin

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

Which CSS property add space between a box’s content and its border?

A

padding

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

What is a pseudo-class

A

classes applied by browser based on certain state

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

What are CSS pseudo-classes useful for?

A

style without adding classes to elements/updating HTML

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

Name at least two units of type size in CSS

A

px, em, rem

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

What CSS property controls the font used for the text inside an element?

A

font-family

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

What is the default flex-direction of a flex container?

A

row

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

What is the default flex-wrap of a flex container?

A

no-wrap

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

Why do two div elements “vertically stack” on one another by default?

A

block elements

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

What is the default flex-direction of an element with display: flex?

A

row

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

What is the default value for the position property of HTML elements?

A

static

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

How does setting position: relative on an element affect document flow?

A

it doesnt

46
Q

How does setting position: relative on an element affect where it appears on the page?

A

no movement without any other changes

47
Q

How does setting position: absolute on an element affect document flow:

A

its removed from the document flow

48
Q

How does setting position: absolute on an element affect where it appears on the page?

A

It starts in the container of its closest non-static, parent element.

49
Q

How do you constrain an absolutely positioned element to a containing block?

A

set the containing block to something other than static (relative)

50
Q

What are the four box offset properties?

A

top, right, bottom, left

51
Q

What is the purpose of variables?

A

To store values. Can change and update and data permanence.

52
Q

How do you declare a variable?

A

Var name;

53
Q

How do you initialize (assign a value to) a variable?

A

var name = “value”;

54
Q

What characters are allowed in variable names?

A

letter, _, $, numbers (not as first character)

55
Q

What does it mean to say that variable names are “case sensitive”?

A

case matters

56
Q

What is the purpose of a string?

A

Store or manipulate text

57
Q

What is the purpose of a number?

A

Math and number quantities

58
Q

What is the purpose of a boolean?

A

“on and off switch”, store true and false values. exist for decision making.

59
Q

What does the = operator mean in JS?

A

assignment operator

60
Q

How do you update the value of a variable?

A

dont need var, just assign variable a new value

61
Q

What is the difference between null and undefined?

A

null always needs to be assigned as a value, intentional “empty” value. Undefined is “empty” from JS engine, unintentional, devs dont use it, signifies something went wrong.

62
Q

Why is it a good habit to include “labels” when you log values to the browser?

A

Give a point of reference

63
Q

What data type is returned by an arithmetic operation?

A

number

64
Q

What is string concatenation?

A

combining of strings

65
Q

What purpose(s) does the + operator serve in JS?

A

addition, combination

66
Q

What purpose(s) does the + operator serve in JS?

A

addition, concatenation

67
Q

What does the += operator do?

A

adds the values and makes the result equal to the first variable

68
Q

What are objects used for?

A

store several properties

69
Q

What are object properties?

A

similar to a variable for objects

70
Q

Describe object literal notation?

A

curly braces to open and close, properties and values inside

71
Q

How do you remove a property from an object?

A

delete keyword

72
Q

What are the two ways to get or update the value of a property?

A

bracket, or dot notation

73
Q

What are arrays used for?

A

Store index/value pairs, ordered lists of data.

74
Q

Describe array literal notation.

A

square brackets, data separated by commas

75
Q

How are arrays different from “plain” objects?

A

index/value pairs instead of key/value pairs

76
Q

What number represents the first index of an array?

A

0

77
Q

What is the length property of an array?

A

gives a number value for items in an array

78
Q

How do you calculate the last index of an array?

A

array.length - 1

79
Q

What is a function in JS?

A

instructions to perform a task

80
Q

Describe the parts of a function definition

A
function name(parameters) {
code block }
81
Q

Describe the parts of a function call

A

name(arguments)

82
Q

When comparing, what are the differences between a function call and definition?

A

Definition needs function keyword, definition has parameters and includes code block.

83
Q

What is the difference between a parameter and an argument?

A

parameter is a placeholder, argument is data being passed into the function when called

84
Q

Why are function parameters useful?

A

placeholders for values

85
Q

What two effects does a return statement have on the behavior of a function

A

returns result of code block expression, ends function

86
Q

Why do we log things to the console?

A

To check our work

87
Q

What is a method?

A

A function that is a property of an object

88
Q

How is a method different from any other function

A

syntax

89
Q

How do you remove the last element from an array?

A

pop()

90
Q

How do you round a number down to the nearest integer?

A

Math.floor()

91
Q

How do you generate a random number?

A

Math.random()

92
Q

How do you delete and element from an array?

A

splice, shift, pop

93
Q

How do you append an element to an array?

A

push()

94
Q

Do string methods change the original string? How would you check if you werent sure?

A

no, strings are immutable

95
Q

Do string methods change the original string? How would you check if you werent sure?

A

no, strings are immutable. Check MDN

96
Q

Roughly how many string methods are there according to MDN Web docs?

A

a lot

97
Q

Is the return value of a function of method useful in every situation?

A

no (example, splice returns deleted values. may be useful, may not)

98
Q

Roughly how many array methods are there according to the MDN Web doc?

A

a lot

99
Q

What three-letter acronym should you always include in your google search about a JavaScript method or CSS property

A

MDN

100
Q

Give 6 examples of comparison operators

A

, &&, ||, <=, >=

101
Q

What data type do comparison expressions evaluate to?

A

boolean

102
Q

What is the purpose of an if statement?

A

condition

103
Q

Is else required in order to use an if statement?

A

no

104
Q

Describe the syntax (structure) of an if statement.

A

if () {

}

105
Q

What are the three logical operators?

A

and, or, not

106
Q

How do you compare two different expressions in the same condition?

A

using and, or operators

107
Q

What are the four components of “The Cascade”

A

inheritance, specificity, source order, important

108
Q

How is it possible for the styles of an element to be applied to its children as well without an additional CSS rule?

A

inheritance allows child elements to use styling from parent elements

109
Q

List three selector types in order of increasing specificity

A

type, class, id

weakest—> strongest

110
Q

Why is using !important considered bad practice?

A

interrupts the cascade flow

111
Q

What does the express.json() middleware do and when would you need it?

A

Parses JSON payload (body) of incoming requests.

You would need it when receiving JSON type data/ objects

112
Q

What is the significance of an HTTP request’s method?

A

Determines the functionality