HTML Flashcards

1
Q

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

A

within 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

within the body element

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

head tags goes between html and body tags. body tags goes between closing head and closing 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

The DOCTYPE declaration is an instruction to the web browser about what version of HTML the page is written in. This ensures that the web page is parsed the same way by different web browsers.

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

Give five examples of HTML element tags.

A

div, a, img, link, p

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

Attributes provide additional information about elements

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

¢–cent–¢

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

A block-level element always starts on 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

An inline element does not start on a new 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

A block-level element always takes up the full width available (stretches out to the left and right as far as it can). the height is 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

An inline element only takes up as much width as necessary.(auto) the height is also 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 list and an unordered list in HTML?

A

The unordered list items have no orders and will be marked with bullets (small black circles) by default. the ordered list items are displayed by order and will be marked with numbers by default

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 element

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 (a) tag

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

What is an absolute URL?

A

a full web address

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

What is a relative URL?

A

a local link, which is to a page within the same website

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

use ../ to indicate the directory above the current one, then follow it with the file name

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

for a child directory, use the name of the child directory, followed by /, then the file name

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

repeat the ../ to indicate that we want to go up two directories, then follow it with the file name

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 use the 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

An HTML form is used to collect user input. The user input is most often sent to a server for processing.

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, select, textarea, button,option

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

text, password, email

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

Is an HTML (input) element a block element or an inline element?

A

inline

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

What are the six primary HTML elements for creating tables

A

table, thead, tbody, tr, td, th

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

thead is to groups the header content in a table;

tbody is to groups the body content in a table

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

accounting info, 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 and 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

with the . followed by class name

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

state the type name directly

31
Q

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

A

with the # followed by Id name

32
Q

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

A

RGB values, hex codes, color names

33
Q

What CSS properties make up the box model?

A

border, margin, padding

34
Q

Which CSS property pushes boxes away from each other?

A

margin

35
Q

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

A

padding

36
Q

What is a pseudo-class?

A

a keyword added to a selector that specifies a special state of the selected element(s)

37
Q

What are CSS pseudo-classes useful for?

A

Pseudo-classes let you apply a style to an element not only in relation to the content of the document tree, but also in relation to external factors such as user actions

38
Q

Name at least two units of type size in CSS.

A

pixels, percentage

39
Q

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

A

font-family

40
Q

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

A

row

41
Q

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

A

unwrap

42
Q

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

A

block level element

43
Q

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

A

row

44
Q

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

A

static

45
Q

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

A

not affect

46
Q

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

A

no change

47
Q

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

A

removed from doc flow entirely

48
Q

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

A

move to the left top corner to the parent relative element

49
Q

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

A

set the parent element position relative

50
Q

What are the four box offset properties?

A

up, bottom, left, right

51
Q

What is the purpose of variables?

A

store data, get value inside a function, have value permanent, access later

52
Q

How do you declare a variable?

A

var, let, const,

53
Q

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

A

var name of variable = value

54
Q

What characters are allowed in variable names?

A

letter, digits, underscore, dollar signs. start with letter(or $ and _)

55
Q

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

A

different case is different variable

56
Q

What is the purpose of a string?

A

store data of text content and characters

57
Q

What is the purpose of a number?

A

store numerical value for counts, calculation

58
Q

What is the purpose of a boolean?

A

store true and false, allow computer to make decision

59
Q

What does the = operator mean in JavaScript?

A

put value inside something.

60
Q

How do you update the value of a variable?

A

use variable name = new value

61
Q

What is the difference between null and undefined?

A

null has to be assigned, undefined (no assign and no value defined by JS). both no value

62
Q

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

A

easy to identify the values

63
Q

Give five examples of JavaScript primitives.

A

string, number, boolean, array, objects

64
Q

What data type is returned by an arithmetic operation?

A

number

65
Q

What is string concatenation?

A

Joining together strings in JavaScript

66
Q

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

A

math or concatenation

67
Q

What data type is returned by comparing two values (, ===, etc)?

A

boolean

68
Q

What does the += “plus-equals” operator do?

A

The addition assignment operator (+=) adds the value of the right operand to a variable and assigns the result to the variable.

69
Q

What are objects used for?

A

to create a collection of data, store data together

70
Q

What are object properties?

A

Object properties are defined as a simple association between name and value. All properties have a name and value is one of the attributes linked with the property, which defines the access granted to the property.

71
Q

Describe object literal notation.

A

object name ={ property: value, …. }

72
Q

How do you remove a property from an object?

A

delete object.key

73
Q

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

A

dot notation and bracket notation