HTML Flashcards

HTML Quiz Questions from LFZ Full Time Immersive

1
Q

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

A

Inside 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

Inside the body element

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

Where do the meta, link, and title tags go in a valid HTML document?

A

They go after the DOCTYPE and inside the head tag

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

What is the purpose of the DOCTYPE declaration?

A

It tells the browser which version of HTML we are using so it can accurately render the page

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

Give 5 examples of element types.

A

head, body, h1 - h6, div, nav

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 (CAN add functionality like src for img)

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

Ampersand ( & amp )

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

What are the two functions of an alt attribute?

A
  1. shows text content if image doesn’t load
  2. Reads outloud for people using screenreaders for accessibility
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do block-level elements affect the document flow?

A

Each new block-level element starts a new line

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

How do inline-level elements affect the document flow?

A

They line up “inline”, appearing on the same line (assuming space is available)

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 a block-level element?

A

Width: width of page; Height: height of content

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

What are the default width and height of an inline element?

A

Width: width of content; Height: height of content

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

Why are strong and em tags preferred over b and i tags for bold and italic text?

A

Strong and em tags add semantic meaning, and screen readers will interpret them appropriately.

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

What is the difference between an ordered list and an unordered list in HTML?

A

Ordered lists emphasize order of items, while unordered lists just have bullet points

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

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

A

Lists (ul, ol, & li) are all block elements

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

True or False? The only direct child a ul or ol element should have is an li element?

A

True

17
Q

What HTML tag is used to link to another website?

A

the a (anchor) tag

18
Q

What is an absolute URL?

A

Absolute URLs link to separate websites

19
Q

What is a relative URL?

A

Relative URLs link to a different page of the same website

20
Q

How do you open up a website in a new tab when using absolute URL paths?

A

Add the target attribute with the value “_blank”

21
Q

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

A

../ (indicates the folder above the current one) then follow with the file name

22
Q

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

A

/ Child folder name / file name

23
Q

How to you indicate the relative link to a grandparent directory?

A

../ ../ file folder name

24
Q

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

A

Just use the file name (nothing else needed)

25
Q

What is the purpose of an HTML form element?

A

Forms allow users to perform functions online and collect data resulting from those functions

26
Q

Give five examples of form control elements

A

Text/password input, radio buttons, drop down boxes, file input boxes, submit/img button

27
Q

Give three examples of type attribute values for HTML input elements

A

Type, name, value

28
Q

Is the HTML input element a block element or an inline element

A

Inline-block!

29
Q

All buttons in a form have a default type attribute of…?

A

Submit

30
Q

6 primary elements for tables

A

Table, thead, tbody, tr, th, td

31
Q

What purpose do the thead and tbody serve?

A

Thead defines a set of rows heading each column of the tables; tbody is the rows w/data

32
Q

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

A

Sports Statistics & Weekly weather forecasts