HTML Flashcards

1
Q

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

A

In the head element which stores the metadata. Metadata tells the browser more information about the document.

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

Within the html element. The head element is first, and stores all metadata. And the body element is second, and stores all visible content.

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

What is the purpose of a!DOCTYPEdeclaration?

A

To let the browser know what kind of document it is, so that it can properly read it.

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
head

body
title
h1
p
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

Attributes (which sit inside of tags) contain more information about the content of the element.

(Attributes contain values within double quotes.)
Syntax:
attribute=“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

© copyright character: ©
& ampersand : &
“ Quotation mark: “

(html entities / escape characters must always be followed by semicolons.)

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

Block-level elements always start on a new line, therefore breaking up the flow of the document.

Block level elements can contain inline-level elements, but not vice versa or the block elements would break the flow.

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

Inline elements always appear to continue on the same line as their neighboring elements. They do not break up the document flow, but rather flow together seamlessly.

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

Block-level elements always take up as much width as possible (100%). And they only take up as much height as the content inside of them.

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

Inline elements only take up as much width and height as is necessary.

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

In ordered lists, items are listed numerically.
In unordered lists, items are listed by bullet points.

(The only valid child elements of these elements. are li elements. The li element represents an item in a list.)

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

Block element. (The li elements are block elements as well.)

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 tags (a).

a tags are used to create links to other websites or links to pages within the same website.

a tags contain the href attribute which contains the link. Within the a element, the text content is what the user will see and click on.

URLs to external sites are absolute URLs.
URLs to pages within the same site are relative URLs.

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

What is an absolute URL?

A

Absolute URLs link to external webpages.

e. g.
https: //www.google.com/
https: //www.healthline.com/health/breathing-exercise

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

What is a relative URL?

A

Relative URLs link to pages within the same site. They are shorthand versions of absolute URLs because they do not need to contain domain names.

e.g.
index.html
../about-me/about-me.html
images/funny-image.png

17
Q

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

A

Use ../ to indicate the folder above the current one, then follow it with the file name.

18
Q

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

A

Use the name of the child folder, followed by a forward slash, then the file name.

19
Q

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

A

Repeat the ../ to indicate that you want to go up two folders (rather than one), then follow it with the file name.

20
Q

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

A

To link a file in the same folder, just use the file name. (Nothing else is needed.)

21
Q

What is the purpose of an HTML form element?

A

HTML borrows the concept of a form to refer to different elements that allow you to collect information from visitors to your site.

22
Q

Give five examples of form control elements.

A
input
label
select
option
submit
textarea
button
23
Q

Give three examples oftypeattributes for HTMLinputelements.

A
type=“text”
type=“password”
type=“radio”
type=“checkbox”
type=“file”
type=“submit”
type=“image”
type=“hidden”
type=“date
type=“email”
type=“search”
24
Q

Is an HTMLinputelement a block element or an inline element?

A

Inline element – to make it block level, wrap it in a div.

25
Q

What are the six primary HTML elements for creating tables?

A

table
tr (table row)
th (table head)
td (table data)

thead (table head)
tbody (table body)

26
Q

What purpose do thetheadandtbodyelements serve?

A

thead and tbody elements help to distinguish content from the head from the body, as well as to group content together.

–thead, tbody, tfoot–
There are three elements that help distinguish between the main content of the table and the first and last rows (which can contain different contents).

These elements help people who use screen readers and also allow you to style these sections in a different manner than the rest of the table.

27
Q

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

A

—Schedules / calendars: display days of the week and hours with scheduled items

—Anything that has to do with displaying numbers like financing and budgeting

—Weather: displaying days and times + temperatures

—Statistics

These types of data are typically referred to “tabular data”.