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

Nested as a child of the HTML element.

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

To let the browser know what type of documentation to display.

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

head, body, html, div, 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

To give more information about an element; makes it special or unique from other 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

trademarks, copyrights, greater than, less than, etc

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 on a new line and take up the entire 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 only take up the space they need and can remain 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

The default width is 100% of the viewpoint and height is usually set to auto (how much it needs).

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

Default width and height are measured by exactly how much they need.

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

An ordered list displays in a numbered order. An unordered list is displayed with bullet points.

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

It is 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

With an 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

When the value of href(attribute) is linked to another page in another website.

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

What is a relative URL?

A

It is a link to another page or section within the same site.

17
Q

How do you indicate the relative link to a parent directory?

A

It is indicated by ../

18
Q

How do you indicate the relative link to a child directory?

A

Using the name of the directory followed by ‘/’ and then the name of the file.

19
Q

How do you indicate the relative link to a grand parent directory?

A

It is indicated by ../../ and then the name of the file.

20
Q

How do you indicate the relative link to the same directory?

A

It is indicated by just the name of the file.

21
Q

What is the purpose of an HTML form element?

A

To let users input data or information and allows us to collect that data.

22
Q

Give five examples of form control elements.

A

form, input, text area, select (drop down list box), button, labels

23
Q

Give three examples of type attributes for HTML elements.

A

text, password, radio, checkbox, file, submit, image

24
Q

Is an HTML element a block element or an inline element?

A

It is an inline element.

25
Q

What are the six primary HTML elements for creating tables?

A

table, tr(table row), td(table data), th(table heading), thead(heading of the table should sit inside), tbody(the body of the table should sit inside), tfoot(the footer of the table should sit inside)

26
Q

What purpose do the thead and tbody elements serve?

A

It helps us distinguish what goes inside the heading of the table and the data that is inserted into the table. It also helps people who use screen readers.

27
Q

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

A

A box score to a sports game, sales records for a company

28
Q

What is the event.target?

A

the element where the event started from or dispatched from

29
Q

Why is it possible to listen for events on one element that actually happen its descendent elements?

A

due to event bubbling

30
Q

What DOM element property tells you what type of element it is?

A

event.target.tagName

31
Q

What does the element.closest() method take as its argument and what does it return?

A

argument is a string containing a css selector and it returns the DOM element object that matches that selector

32
Q

How can you remove an element from the DOM?

A

the remove method. call that on the element you want to remove

33
Q

If you wanted to insert new clickable DOM elements into the page using JavaScript, how could you avoid adding an event listener to every new element individually?

A

by using event delegation. can use an if statement not equal to ‘element in capital letters / attaching it to the element that contains the element you are trying to manipulate