HTML Flashcards

1
Q

What tags are necessary for a complete HTML Skeleton?

A

(1) doctype declaration
(2) html tag
(3) head
(4) title (in the head)
(5) body

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

What type of content belongs within the of an HTML document?

A

Meta-information/meta-data (non-visible content)

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

What type of content belongs within the of an HTML document?

A

Content that the user will see

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

Where must the DOCTYPE declaration appear in a valid HTML document?

A

At the very top

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

Do all HTML elements require a closing tag?

A

No, some are empty/self-closing/void

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

What are attributes for in HTML?

A

To customize elements

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

What is the purpose of the alt attribute used on <img></img> elements?

A

Shows text (describing the image) if the image doesn’t load properly

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

How many heading elements are available in HTML?

A

6

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

How do link to a file in the same folder as the current HTML document?

A

href attribute + name of the file in the current directly or (./)

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

How do you link to a file in a folder one level up from the folder containing the current HTML document?

A

href=”../” (parent directory) + name of file

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

What is the difference between an absolute file path and a relative file path on the Web?

A

absolute = outside source, relative = internal source

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

What is a hyperlink?

A

anchor/link that takes you somewhere (to a different document, image, etc.)

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

What is the purpose of CSS?

A

To help format/design a web page

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

Describe the syntax of a CSS rule-set.

A

A CSS Syntax rule consists of a selector, property, and its value.

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

Which CSS properties make up the box model?

A

Margins, padding, borders, and the actual content (width and height).

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

Which CSS property pushes boxes away from each other?

A

Margin

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

Which CSS property pushes box content away from its border?

A

Padding

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

What are some characteristics of block?

A

Displays an element as a block element (like <p>). It starts on a new line, and takes up the whole width.</p>

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

What are some characteristics of inline?

A

Displays an element as an inline element (like <span>). Any height and width properties will have no effect.</span>

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

What are some characteristics of inline-block?

A

Displays an element as an inline-level block container. The element itself is formatted as an inline element, but you can apply height and width values.

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

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

A

nowrap

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

What is one of the uses of Flexbox?

A

To help with page layout

24
Q

What are the three primary parts of a layout system?

A

Container, row, and column.

25
What does the = (equals) operator do in JavaScript?
To assign a value (but does not mean "equal")
26
Which keyword is used to declare a variable in JavaScript?
var
27
Which characters is a JavaScript variable allowed to begin with?
Any letters, dollar sign ($), underscore (_),
28
What are quotation marks used for in JavaScript?
To create a string for text/data
29
What is the purpose of booleans in JavaScript?
To represent true or false values
30
What is the purpose of numbers in JavaScript?
Used to represent quantities and perform calculations
31
What does null mean in JavaScript?
It's the intentional absence of a value
32
What data types can object properties hold?
All of them (strings, booleans, numbers, etc.)
33
Describe the syntax (structure) of object-literals in JavaScript.
var or constant declaration; object; equal sign; open curly brace; key:value pair; comma if adding more; end curly brace; semi-colon. ``` var person = { firstName: 'Novi', lastName: 'Le', hobby: 'Traveling' }; ```
34
What is the principal use of arrays?
The purpose of an array is to store multiple pieces of data of the same type together and to store data in a specific order.
35
Describe the syntax (structure) of array-literals in JavaScript.
var or const + object = comma separated list of values surrounded by square brackets ([...])
36
What number represents the first index of an array?
0
37
How can you access the last element of an array?
length (of the array) - 1
38
What are the five parts of a function definition?
``` function keyword the function name the parameter list the code block the return statement ```
39
How do you call a function?
function name + the argument list inside of the parentheses
40
What is the difference between a parameter and an argument?
``` parameters = placeholder used for defining function agrument = value passed to a function when you call it ```
41
What does strictly equal mean?
the operators on each side of the === sign have to be the same value and type
42
What is the logical and operator?
&&
43
Can you name some comparison operators?
strictly equal (===), equal to (==), not equal (!=), not strictly equal (!==), > (greater than (>), less than (<). greater than or equal to (>=), less than or equal to (<=)
44
When is the first expression in the parentheses for a for loop (known as the initialization) evaluated?
first (and only once)
45
When is the second expression in the parentheses for a for loop (known as the condition) evaluated?
before each iteration of a loop the condition expression is evaluated
46
What is the purpose of the condition in a for loop?
to terminate the loop
47
When is the third expression in the parentheses for a for loop (known as the final expression) evaluated?
after each iteration of the code block
48
What is the purpose of the final expression in a for loop?
drives the loop toward termination (so that after each iteration, we get closer to our condition expression becoming false)
49
What is the DOM?
Document Object Model = standard interface between Javascript and the page
50
What does document.querySelector() return?
the first Element within the document that matches the specified selector, or group of selectors
51
How do you modify the text of elements on the DOM?
with the textContent property
52
What arguments does the addEventListener method take?
the event, the function
53
Give five examples of JavaScript events that can be listened for.
click, mouse move, cut, copy, paste, animation, drag etc.
54
What does document.createElement() take as its argument?
the tag name of the element written as a string
55
What does document.createElement() return?
returns newly created DOM element (based off the new tag)
56
How do you append elements to the DOM?