HTML Flashcards

HTML flashcards

1
Q

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

A

In the head element.

Note: the title element within the head element will be visible at the top of the browser or in the browser tab.

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

In 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

In the html element located beneath the doctype declaration.

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

Ensures that the browser renders the document as HTML and follows HTML specifications.

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
  1. body
  2. head
  3. title
  4. line break: br
  5. span
    - extra-
  6. horizontal rule: hr
  7. anchor: a (with href attribute and file path)
  8. p
  9. div
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 provide more information about the contents of the associated element. It is comprised of an attribute name and a corresponding value.

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: (ampersand symbol)amp;
-extra-
Trademark: (ampersand symbol)trade;

Note: All end with semicolon.

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

Breaks the document flow and creates line breaks between neighboring elements, starts on a new line.
Note: They take up the entire horizontal space of its parent element, and the vertical space needed for its contents.

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

The elements will appear to continue on the same line as neighboring elements. Note: Takes up the least amount of space available bounded by the tags defining the element, instead of breaking the flow of the content.

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

All of the horizontal space available within its parent element (container), and the vertical space needed for the height of its contents.

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 does not start on a new line and only takes up as much width and height as necessary, bounded by the tags defining the element.

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

Ordered lists are numbered or in sequence (A-Z) and unordered lists are not numbered and use 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

The list and list items are both block-level elements.

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 tag with an href attribute.

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

What is an absolute URL?

A

An absolute URL starts with the domain name for that site and can be followed by the path to a specific page. Used for external website links.

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

What is a relative URL?

A

A URL that links to other pages within the same site, you do not need to specify the domain name in the URL.

17
Q

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

A

../file-name

18
Q

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

A

child-folder-name/file-name

19
Q

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

A

../../file-name

Note: use ../ for each generation of directories.

20
Q

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

A

File-name

21
Q

What is the purpose of an HTML form element?

A

To obtain information and data from users via a structured set of elements.

22
Q

Give five examples of form control elements.

A

form, fieldset, legend, textarea, label
-extra-
button, and input

23
Q

Give three examples of type attributes for HTML input elements.

A

Radio, button, checkbox,
-extra-
image, submit, text

24
Q

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

A

Inline, and that is why we have to insert them into a div.

25
Q

What are the six primary HTML elements for creating tables?

A

Table, thead, th, tr, td, tbody

26
Q

What purpose do the thead and tbody elements serve?

A

The tbody element encapsulates a set of table rows indicating that they are the body of the table. The thhead element defines a set of rows as the head of the columns of the table.

Both, along with tfoot, provide useful semantic information that can be used when rendering for either screen or printer as well as for accessibility purposes.

27
Q

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

A

Financial data and reports, schedules, game scores, inventory control.

28
Q

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

A

Because they are block elements and are vertically-based, by default fill 100% of the horizontal space available.