HTML Flashcards

1
Q

What is HTML and what is it used for?

A

HTML is a textual language for creating webpages.

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

What is the format of an HTML file?

A
  • Start with an indication of the document type
  • then a head part with the page title and other page information
  • Finally a body part with the actual page content
  • May also contain CSS and JavaScript code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is an HTML element?

A

A single HTML structure that is represented with HTML tags. Most HTML elements have an opening and closing tag.

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

How do you write HTML opening / closing tags for the ‘p’ element?

A

<p> paragraph </p>

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

What are common HTML elements?

A
  • h1, h2, h3: Headers, largest to smallest
  • p: paragraph
  • em, strong: italics and bold
  • img: image (no closing tag)
  • a: Link
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are HTML tag attributes?

A

Special words used inside the opening tag to control the element’s behaviour.

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

How does an anchor element create a link on a webpage?

A

With the href attribute in the opening a tag. Ex: a href=”link” </a>

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

What is the syntax of a comment in HTML?

A

< ! - - Text - - >
(no whitespace normally)

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

What is a void element?

A

An element that only needs an opening tag

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

What tag is the first in every .html?

A

The “!DOCTYPE html” tag.

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

What is enclosed by the “html” element?

A

Everything but the “!DOCTYPE html” tag

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

What element contains other elements not typically displayed in the webpage?

A

The “head” element

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

What element describes the documents data?

A

The “meta” element.

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

What does the “title” element specify?

A

The Documents name, usually displayed in the browser’s titlebar,

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

What element contains other elements rendered in the browser?

A

The “body” element

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

Why is it smart to use an HTML validator?

A

To check for depreciated HTML that may be handled unpredictably by browsers.

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

What is the tag to create a newline?

A

“br”

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

How is whitespace handled in HTML?

A

Multiple whitespace and newline characters will all be treated as a single whitespace

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

What is an HTML container?

A

Any element in a web document body that has opening and closing tags.

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

What content is held in the head container?

A

Introductory content

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

What content is held in the footer container?

A

Descriptive information about the webpage like author, copyright, or date modified

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

What content is held in the address container?

A

The person’s or organization’s contact information

23
Q

What content is held in the main container?

A

The document’s primary content

24
Q

What content is held in the section container?

A

Distinct parts of a document, such as a chapter

25
Q

What content is held in the article container?

A

Self-contained content that can be reused independently, such as a news article

26
Q

What content is held in the nav container?

A

Content relating to website navigation

27
Q

What content is held in the aside container?

A

Content not directly related to the main topic of a document

28
Q

What content is held in the div container?

A

Generic element for creating block containers

29
Q

What content is held in the span container?

A

Generic element for creating inline containers

30
Q

What is a block element?

A
  • Fills the width of the element’s parent container and can contain other block elements, inline elements, and text.
  • typically displayed starting and ending on new lines
31
Q

What is an inline element?

A
  • fills the minimum space possible in the element’s parent container
  • can only contain text or other inline elements
32
Q

What is best practice when selecting containers?

A

Select containers that convey semantic meaning and use div and span only when no other elements are appropriate

33
Q

What are the tags for unordered and ordered lists?

A
  • ul: unordered list.
  • ol: ordered list.
34
Q

What are the attributes to specify list type in an ordered list?

A

type = :
- 1: Numbered list
- A: uppercase letters
- a: lowercase letters
- I: uppercase roman numerals
- i: lowercase roman numerals

35
Q

How do you change the bullets in an unordered list?

A

With the CSS style=list-style-type: property

36
Q

How do you nest a list in HTML?

A

You insert the list tag within the li tag of an item in the parent list.

37
Q

What is the element to create a table?

38
Q

What are the common table elements to interact with the table?

A
  • caption : immediately follows the table tag
  • tr : creates a row of cells
  • th : creates a cell containing a header
  • td : creates a cell containing table data
39
Q

What attributes allow a td cell to occupy more than 1 cell?

A

colspan and rowspan. Ex: colspan=”3”

40
Q

What are the 3 image formats used by web browsers?

A
  • JPEG (Joint Photographic Experts Group)
  • PNG (Portable Network Graphics)
  • GIF (Graphics Interchange Format)
41
Q

Which image format uses “lossy compression” to compress images?

42
Q

Which image format cannot display “true color”?

43
Q

What are the most common URL schemes in an href attribute?

A
  • http: (send requests and responses over the Internet without encryption.)
  • https: (send requests and responses over the Internet with encryption.)
  • mailto: (send email)
  • file: (refer to a document on the same computer as the web browser)
  • ftp: (transfer data files)
44
Q

What is the difference between an absolute URL and relative URL?

A

Relative URL specifies the relative path to the web resource with no scheme or hostname, while absolute is a complete URL

45
Q

How do you navigate to the parent directory in a relative URL?

46
Q

How do you create a fragment identifier?

A

With the “id” attribute.

47
Q

What does adding a fragment identifier do?

A

Allows URLs to link directly to the id’s location in the document

48
Q

How do you reference a fragment identifier?

A

With the #(hashtag) after the URL, and then the fragment name. Ex: https://wikidedia.com/lincoln#history

49
Q

What is a graphical hyperlink?

A

Using an img element instead of text to link the href attribute.

50
Q

What are the anchors “target” attribute options?

A
  • _self (navigate in the current page)
  • _blank (open in a new tab or window)
51
Q

What is an entity in HTML?

A

A mechanism for writing special characters or symbols

52
Q

How do you access an HTML entity?

A
  • The entity name, if it exists. Ex: & copy;
  • The Decimal number. Ex: & #169;
  • The Hexadecimal number. Ex: \&x000A9;
53
Q

What are the entity names for non-breaking hyphen, and non-breaking whitespace, and what do they do?

A

They create a hyphen or whitespace that will not allow wrap around of the word if at the end of a line.
- & #8209;
- & nbsp;