HTML Flashcards

(53 cards)

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
What content is held in the article container?
Self-contained content that can be reused independently, such as a news article
26
What content is held in the nav container?
Content relating to website navigation
27
What content is held in the aside container?
Content not directly related to the main topic of a document
28
What content is held in the div container?
Generic element for creating block containers
29
What content is held in the span container?
Generic element for creating inline containers
30
What is a block element?
- 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
What is an inline element?
- fills the minimum space possible in the element's parent container - can only contain text or other inline elements
32
What is best practice when selecting containers?
Select containers that convey semantic meaning and use div and span only when no other elements are appropriate
33
What are the tags for unordered and ordered lists?
- ul: unordered list. - ol: ordered list.
34
What are the attributes to specify list type in an ordered list?
type = : - 1: Numbered list - A: uppercase letters - a: lowercase letters - I: uppercase roman numerals - i: lowercase roman numerals
35
How do you change the bullets in an unordered list?
With the CSS style=list-style-type: property
36
How do you nest a list in HTML?
You insert the list tag within the li tag of an item in the parent list.
37
What is the element to create a table?
Table
38
What are the common table elements to interact with the table?
- 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
What attributes allow a td cell to occupy more than 1 cell?
colspan and rowspan. Ex: colspan="3"
40
What are the 3 image formats used by web browsers?
- JPEG (Joint Photographic Experts Group) - PNG (Portable Network Graphics) - GIF (Graphics Interchange Format)
41
Which image format uses "lossy compression" to compress images?
JPEG
42
Which image format cannot display "true color"?
GIF
43
What are the most common URL schemes in an href attribute?
- 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
What is the difference between an absolute URL and relative URL?
Relative URL specifies the relative path to the web resource with no scheme or hostname, while absolute is a complete URL
45
How do you navigate to the parent directory in a relative URL?
../
46
How do you create a fragment identifier?
With the "id" attribute.
47
What does adding a fragment identifier do?
Allows URLs to link directly to the id's location in the document
48
How do you reference a fragment identifier?
With the #(hashtag) after the URL, and then the fragment name. Ex: https://wikidedia.com/lincoln#history
49
What is a graphical hyperlink?
Using an img element instead of text to link the href attribute.
50
What are the anchors "target" attribute options?
- _self (navigate in the current page) - _blank (open in a new tab or window)
51
What is an entity in HTML?
A mechanism for writing special characters or symbols
52
How do you access an HTML entity?
- The entity name, if it exists. Ex: & copy; - The Decimal number. Ex: & #169; - The Hexadecimal number. Ex: \&x000A9;
53
What are the entity names for non-breaking hyphen, and non-breaking whitespace, and what do they do?
They create a hyphen or whitespace that will not allow wrap around of the word if at the end of a line. - & #8209; - & nbsp;