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
Q

What does the = (equals) operator do in JavaScript?

A

To assign a value (but does not mean “equal”)

26
Q

Which keyword is used to declare a variable in JavaScript?

A

var

27
Q

Which characters is a JavaScript variable allowed to begin with?

A

Any letters, dollar sign ($), underscore (_),

28
Q

What are quotation marks used for in JavaScript?

A

To create a string for text/data

29
Q

What is the purpose of booleans in JavaScript?

A

To represent true or false values

30
Q

What is the purpose of numbers in JavaScript?

A

Used to represent quantities and perform calculations

31
Q

What does null mean in JavaScript?

A

It’s the intentional absence of a value

32
Q

What data types can object properties hold?

A

All of them (strings, booleans, numbers, etc.)

33
Q

Describe the syntax (structure) of object-literals in JavaScript.

A

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
Q

What is the principal use of arrays?

A

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
Q

Describe the syntax (structure) of array-literals in JavaScript.

A

var or const + object = comma separated list of values surrounded by square brackets ([…])

36
Q

What number represents the first index of an array?

A

0

37
Q

How can you access the last element of an array?

A

length (of the array) - 1

38
Q

What are the five parts of a function definition?

A
function keyword
the function name
the parameter list
the code block
the return statement
39
Q

How do you call a function?

A

function name + the argument list inside of the parentheses

40
Q

What is the difference between a parameter and an argument?

A
parameters = placeholder used for defining function
agrument = value passed to a function when you call it
41
Q

What does strictly equal mean?

A

the operators on each side of the === sign have to be the same value and type

42
Q

What is the logical and operator?

A

&&

43
Q

Can you name some comparison operators?

A

strictly equal (===), equal to (==), not equal (!=), not strictly equal (!==), > (greater than (>), less than (<). greater than or equal to (>=), less than or equal to (<=)

44
Q

When is the first expression in the parentheses for a for loop (known as the initialization) evaluated?

A

first (and only once)

45
Q

When is the second expression in the parentheses for a for loop (known as the condition) evaluated?

A

before each iteration of a loop the condition expression is evaluated

46
Q

What is the purpose of the condition in a for loop?

A

to terminate the loop

47
Q

When is the third expression in the parentheses for a for loop (known as the final expression) evaluated?

A

after each iteration of the code block

48
Q

What is the purpose of the final expression in a for loop?

A

drives the loop toward termination (so that after each iteration, we get closer to our condition expression becoming false)

49
Q

What is the DOM?

A

Document Object Model = standard interface between Javascript and the page

50
Q

What does document.querySelector() return?

A

the first Element within the document that matches the specified selector, or group of selectors

51
Q

How do you modify the text of elements on the DOM?

A

with the textContent property

52
Q

What arguments does the addEventListener method take?

A

the event, the function

53
Q

Give five examples of JavaScript events that can be listened for.

A

click, mouse move, cut, copy, paste, animation, drag etc.

54
Q

What does document.createElement() take as its argument?

A

the tag name of the element written as a string

55
Q

What does document.createElement() return?

A

returns newly created DOM element (based off the new tag)

56
Q

How do you append elements to the DOM?

A