HTML Flashcards

(112 cards)

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
What are the 6 primary HTML elements for creating tables?
table, thead, tbody, tr, td, tfoot
26
What purpose do the thead and tbody elements serve?
organizational purpose
27
Give two examples of data that would lend itself well to being displayed in a table.
sport scores, grades, any tabular data
28
What are the names of the individual pieces of a CSS rule?
selector, declaration block, property, value
29
In CSS, how do you select elements by their class attribute
.classname
30
In CSS, how do you select elements by their type?
type name
31
In CSS, how do you select an element by its id attribute?
#idname
32
Name three different types of values you can use to specify colors in CSS.
hex code, RGB, color name, RGBA, HSL (hue saturation and luminosity), HSLA
33
What CSS properties make up the box model?
border, padding, margin
34
Which CSS property pushes boxes away from eachother?
margin
35
Which CSS property add space between a box's content and its border?
padding
36
What is a pseudo-class
classes applied by browser based on certain state
37
What are CSS pseudo-classes useful for?
style without adding classes to elements/updating HTML
38
Name at least two units of type size in CSS
px, em, rem
39
What CSS property controls the font used for the text inside an element?
font-family
40
What is the default flex-direction of a flex container?
row
41
What is the default flex-wrap of a flex container?
no-wrap
42
Why do two div elements "vertically stack" on one another by default?
block elements
43
What is the default flex-direction of an element with display: flex?
row
44
What is the default value for the position property of HTML elements?
static
45
How does setting position: relative on an element affect document flow?
it doesnt
46
How does setting position: relative on an element affect where it appears on the page?
no movement without any other changes
47
How does setting position: absolute on an element affect document flow:
its removed from the document flow
48
How does setting position: absolute on an element affect where it appears on the page?
It starts in the container of its closest non-static, parent element.
49
How do you constrain an absolutely positioned element to a containing block?
set the containing block to something other than static (relative)
50
What are the four box offset properties?
top, right, bottom, left
51
What is the purpose of variables?
To store values. Can change and update and data permanence.
52
How do you declare a variable?
Var name;
53
How do you initialize (assign a value to) a variable?
var name = "value";
54
What characters are allowed in variable names?
letter, _, $, numbers (not as first character)
55
What does it mean to say that variable names are "case sensitive"?
case matters
56
What is the purpose of a string?
Store or manipulate text
57
What is the purpose of a number?
Math and number quantities
58
What is the purpose of a boolean?
"on and off switch", store true and false values. exist for decision making.
59
What does the = operator mean in JS?
assignment operator
60
How do you update the value of a variable?
dont need var, just assign variable a new value
61
What is the difference between null and undefined?
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
Why is it a good habit to include "labels" when you log values to the browser?
Give a point of reference
63
What data type is returned by an arithmetic operation?
number
64
What is string concatenation?
combining of strings
65
What purpose(s) does the + operator serve in JS?
addition, combination
66
What purpose(s) does the + operator serve in JS?
addition, concatenation
67
What does the += operator do?
adds the values and makes the result equal to the first variable
68
What are objects used for?
store several properties
69
What are object properties?
similar to a variable for objects
70
Describe object literal notation?
curly braces to open and close, properties and values inside
71
How do you remove a property from an object?
delete keyword
72
What are the two ways to get or update the value of a property?
bracket, or dot notation
73
What are arrays used for?
Store index/value pairs, ordered lists of data.
74
Describe array literal notation.
square brackets, data separated by commas
75
How are arrays different from "plain" objects?
index/value pairs instead of key/value pairs
76
What number represents the first index of an array?
0
77
What is the length property of an array?
gives a number value for items in an array
78
How do you calculate the last index of an array?
array.length - 1
79
What is a function in JS?
instructions to perform a task
80
Describe the parts of a function definition
``` function name(parameters) { code block } ```
81
Describe the parts of a function call
name(arguments)
82
When comparing, what are the differences between a function call and definition?
Definition needs function keyword, definition has parameters and includes code block.
83
What is the difference between a parameter and an argument?
parameter is a placeholder, argument is data being passed into the function when called
84
Why are function parameters useful?
placeholders for values
85
What two effects does a return statement have on the behavior of a function
returns result of code block expression, ends function
86
Why do we log things to the console?
To check our work
87
What is a method?
A function that is a property of an object
88
How is a method different from any other function
syntax
89
How do you remove the last element from an array?
pop()
90
How do you round a number down to the nearest integer?
Math.floor()
91
How do you generate a random number?
Math.random()
92
How do you delete and element from an array?
splice, shift, pop
93
How do you append an element to an array?
push()
94
Do string methods change the original string? How would you check if you werent sure?
no, strings are immutable
95
Do string methods change the original string? How would you check if you werent sure?
no, strings are immutable. Check MDN
96
Roughly how many string methods are there according to MDN Web docs?
a lot
97
Is the return value of a function of method useful in every situation?
no (example, splice returns deleted values. may be useful, may not)
98
Roughly how many array methods are there according to the MDN Web doc?
a lot
99
What three-letter acronym should you always include in your google search about a JavaScript method or CSS property
MDN
100
Give 6 examples of comparison operators
, &&, ||, <=, >=
101
What data type do comparison expressions evaluate to?
boolean
102
What is the purpose of an if statement?
condition
103
Is else required in order to use an if statement?
no
104
Describe the syntax (structure) of an if statement.
if () { }
105
What are the three logical operators?
and, or, not
106
How do you compare two different expressions in the same condition?
using and, or operators
107
What are the four components of "The Cascade"
inheritance, specificity, source order, important
108
How is it possible for the styles of an element to be applied to its children as well without an additional CSS rule?
inheritance allows child elements to use styling from parent elements
109
List three selector types in order of increasing specificity
type, class, id | weakest---> strongest
110
Why is using !important considered bad practice?
interrupts the cascade flow
111
What does the express.json() middleware do and when would you need it?
Parses JSON payload (body) of incoming requests. You would need it when receiving JSON type data/ objects
112
What is the significance of an HTTP request's method?
Determines the functionality