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

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

To tell the browser what kind of doc it is.

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

What is the purpose of HTML attributes?

A

To provide more information about the elements.

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

Give an example of an HTML entity (escape character).

A

© for Copyright

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

How do block-level elements affect the document flow?

A

Will take up the whole line.

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

How do inline elements affect the document flow?

A

Will only take up as much space as necessary, will share the line with other elements.

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

What are the default width and height of a block-level element?

A

Width: 100%; Height: As much as necessary.

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 an inline element?

A

Width: As much as necessary; Height: As much as necessary.

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

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

A

Ordered lists use an order, for example numbers; unordered lists are not ordered and use bullet points.

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

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

A

Block.

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

What HTML tag is used to link to another website?

A

< a >

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

What is an absolute URL?

A

To an external website. The full path.

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

What is a relative URL?

A

To a different part of the same website. Partial path.

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

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

A

../file

17
Q

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

A

folderName/fileName

18
Q

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

A

../../file

19
Q

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

A

fileName

20
Q

What is the purpose of an HTML form element?

A

To obtain user input.

21
Q

Give five examples of form control elements.

A
  1. input 2. button 3. select 4. textarea 5. option
22
Q

Give three examples of type attributes for HTML

< input > elements.

A
  1. text 2. radio 3. checkbox
23
Q

Is an HTML < input > element a block element or an inline element?

A

Inline.

24
Q

What are the six primary HTML elements for creating tables?

A

table / thead / tbody / tr / td / th

25
Q

What purpose do the thead and tbody elements serve?

A

To separate the table heading from its body. Also helpful for DOM manipulation.

26
Q

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

A

Financial reports.

Show times.

27
Q

When would you use the disabled attribute on an option?

A

If you do not wish to allow a user to choose that option.

28
Q

Why would you use a < button > element for submit if you can use input type=submit?

A

For additional styling of the submit button. Buttons can also have children.

29
Q

When would you use the placeholder attribute?

A

To insert text in gray shade in a textbox. This is not an actual value.

30
Q

Where should the < br > tag be used?

A

Within a paragraph, not between form elements, rather use a div for that.

31
Q

What are 2 ways that you can associate a label with an input element?

A
  1. Using a for attribute on the label, same as id of input element. 2. you can nest the < input > directly inside the < label >
32
Q

What does setting meta tag with device-width do?

A

It makes that the mobile device should not load a virtual screen size, so that media queries should be effective