HTML Flashcards

HTML flashcards

1
Q

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

A

In the head element.

However - 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. The <html> element is the root 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, and where does it go?

A

Ensures that the browser renders the document as HTML and follows HTML specifications. <!DOCTYPE html> specifically means that the document is an HTML5 document. The declaration goes at the very top of the document.

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/> (empty tag with no closing tag)
  5. span
    - extra-
  6. horizontal rule: hr (empty tag with no closing tag)
  7. anchor: a (with href attribute and file path)
  8. p
  9. div
  10. <img/> (empty tag with no closing tag)
  11. `<meta></meta> (empty tag with no closing tag)
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. Attributes are always specified in the opening or start tag. Attributes usually come in name and value pairs, ex: name=”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: &amp; (ampersand symbol)amp;
-extra-
Trademark: &trade; (ampersand symbol)trade;

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.
Block-level elements take up the entire horizontal space of its parent element by default, 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. Inline elements take up the least amount of space available bounded by the tags defining the element, instead of breaking the flow of the content. Any height and width properties will have no effect.

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.

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

../file-name

18
Q

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

A

Href attribute should contain ../../ preceding the file name and type enclosed in double quotes. child-folder-name/file-name

19
Q

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

A

Href attribute should contain ../../ preceding the file name and type enclosed in double quotes.
<a href="../../file-name.type" use ../` for each generation of directories.

20
Q

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

A

Href attribute should simply contain the file name and type enclosed in double quotes.
<a href="file-name.type"></a>

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, and always start on a new line.

29
Q

What tags are necessary for a complete HTML Skeleton?

A

<!DOCTYPE>, <HTML></>, <head></>, <meta></> meta data like character set (UTF-8)<title></> inside the head, and <body></>, which is inside the <HTML> tag.

30
Q

What attribute defines extra info about an element that appears as a tooltip?

A

The title attribute.

31
Q

How many heading elements are in HTML?

A

There are 6 Heading elements in HTML, and the browser automatically adds a margin before and after the heading. There must only be one <H1> heading per HTML document.

32
Q

What are the required attributes for an <img> tag?

A

src - specifies the path to the image, whether absolute or relative
alt - specifies the alternative text describing the image

33
Q

What is a <map> element

A

The <map> tag is used to define an image map. An image map is an image with clickable areas.

The required name attribute of the <map> element is associated with the <img>’s usemap attribute (must have a hashtag I think) and creates a relationship between the image and the map.

The <map> element contains a number of <area> elements, that define the clickable areas in the image map with attributes like shape, coords, alt, and href.

34
Q

What type of content belongs within the <head> of an HTML document?

A

Content that doesn’t get displayed on the webpage, but that’s used for machine processing like <meta> content, <title> content, `<link></link>’ content like stylesheets, and scripts.

35
Q

How do you open a link in a new browser window?

A

Add a target attribute with a value of “_blank” to the anchor <a> element.

36
Q

What is a hyperlink?

A

A hyperlink, or simply a link, is a digital clickable reference to data that a user can follow by clicking or tapping the linked hypertext.

A hyperlink can point to a web resource, such as a whole document or to a specific element within a document.

In HTML, the link is created within an anchor element with an href attribute that indicates the link’s destination URI.

37
Q

How do block, inline, and inline-block property values differ?

A

Block-level elements take up just enough vertical space needed to fit its contents, but always start on a new line and take up all of the available horizontal space as it can by default.

Inline elements take up just enough vertical and horizontal space it needs to fit its contents, and no more. You cannot adjust the height and width properties on inline elements.

Inline-block elements are formatted as as inline element, in that by default it only takes up the vertical and horizontal space needed to fits it’s content, but you can apply height and width values if you’d like.

38
Q

Give some examples of block-level elements.

A
  • div
  • ul
  • li
  • p
39
Q

Give some examples of inline elements.

A
  • span
  • input
  • strong
40
Q

Give some examples of inline-block elements.

A
  • button
  • textarea and select in chrome.