Quiz Questions Flashcards

1
Q

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

A

In the < head > element

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.

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

to define the type of document/file that it is.

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

Give five examples of HTML element types.

A

< head > , < title >, < body >, < p >, < h1 >

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 additional information about HTML elements.

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

© for ©

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 elements will always appear starting on a new line.

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 will always appear to continue on the same line as the neighbouring elements.

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

the default height and width of a block element is the height of the content and width of the page.

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 are both the height and width of the content.

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 list is portrayed with numbers (i.e. in order) and an unordered list is portrayed as a list with bullet points indicating no specific numeric order.

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

yes lists < li > are a block level element tag.

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

the < a href=” “ > tag is used for linking to another website.

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 is one that takes you to a different website outside of your current one.

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

What is a relative URL?

A

A relative URL is one where it links only within the same current website (i.e. navigation for a site).

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

Use ../ to indicate the folder is a parent folder (above the current one), then follow it with the file name.

Ex. < a href=”../index.html” >Home< /a >

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

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

A

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

Ex. < a href=”music/listings.html” >Listings< /a >

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

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

A

Use ../ but twice, to indicate that you want to go up two folders from the current one, followed by the file name.

Ex. < a href=”../../listings.html” >Listings< /a >

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

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

A

Use the file name if it is within the same folder/directory.

Ex. < a href=”listings.html” >Listings< /a >

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

What is the purpose of an HTML form element?

A

An HTML form is used to collect user data/input.

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

Give five examples of form control elements.

A

Ex. - input, label, select, button, textarea

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

Give three examples of type attribute values for HTML < input > elements.

A

Ex. - radio, checkbox, submit

24
Q

Is an HTML < input > element a block element or an inline element?

A

It is an inline-block element.

It’s hybrid, whereas normal inline can’t allow you to adjust height and width, thought you can with inline-block

25
Q

What are the six primary HTML elements for creating tables?

A

tr, th, td, thead, tbody, tfooter, table

26
Q

What purpose do the thead and tbody elements serve?

A

To help distinguish between the heading (shows up as header as well) and body elements of the table in a similar manner to normal HTML structure.

27
Q

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

A

Ex. - financial reports, tv schedules, statistics

28
Q

What are the names of the individual pieces of a CSS rule?

A

selector, declaration block, declarations (each line within the block), property, value, open/close curly brace.

29
Q

In CSS, how do you select elements by their class attribute?

A

you select the class attribute in CSS by using a period ( . )

Ex. .note or .intro

30
Q

In CSS, how do you select elements by their type?

A

you just use their element name.

Ex. h1 will select the h1 element.

31
Q

In CSS, how do you select an element by its id attribute?

A

To select an element by an id, you use the hashtag symbol ( # )

Usually bad practice to style using id selectors for CSS - Tim Horist.

Ex. #introduction

32
Q

Name three different types of values you can use to specify colors in CSS.

A

RGB Value, Hex Code, and Color Name.

33
Q

What CSS properties make up the box model?

A

Padding, Border, Margin

34
Q

Which CSS property pushes boxes away from each other?

A

Margins

35
Q

Which CSS property add space between a box’s content and its border?

A

Padding.

36
Q

What is a pseudo-class?

A

A pseudo-class is used to define a special state of an element.

For example, it can be used to:

Style an element when a user mouses over it
Style visited and unvisited links differently
Style an element when it gets focus

37
Q

What are CSS pseudo-classes useful for?

A

To indicate, hovering of an element via cursor, activation of an element, and when an element has focus.

as a dev, can take advantage of these as you don’t have to modify the html document to add a new specific class.

38
Q

Name two types of units that can be used to adjust font-size in CSS.

A

Pixels, and Percentages (can also use EMS)

39
Q

What CSS property controls the font used for the text inside an element?

A

font-family is the property used to determine the font used for text inside that element.

40
Q

What is the default flex-direction of a flex container?

A

Row

41
Q

What is the default flex-wrap of a flex container?

A

no-wrap

42
Q

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

A

div is block level element

43
Q

What is the default flex-direction of an element with display: flex?

A

row ( left to right )

44
Q

What is the default value for the position property of HTML elements?

A

static positioning

45
Q

How does setting position: relative on an element affect document flow?

A

it does not

46
Q

How does setting position: relative on an element affect where it appears on the page?

A

by adding properties of top/bottom/left/right to move said element from its initial position relative in the normal flow.

47
Q

How does setting position: absolute on an element affect document flow?

A

it is taken out of the normal flow and put into its own sort of plane. so the other elements close in as if it didnt exist.

48
Q

How does setting position: absolute on an element affect where it appears on the page?

A

it depends, if the absolute was contained in a

49
Q

How do you constrain an absolutely positioned element to a containing block?

A

any non static. - fixed/relative/etc.

50
Q

What are the four box offset properties?

A

top/bottom/left/right

51
Q

What are the four components of “the Cascade”.

A

Cascade, Inheritance, Specificity, & !important,

52
Q

What does the term “source order” mean with respect to CSS?

A

The order of read/execution of CSS, from left-to-right then top-to-bottom. ( as long as specificity is the same )

53
Q

How is it possible for the styles of an element to be applied to its children as well without an additional CSS rule?

A

via Inheritance, if there is no specific property for said child element, if it is an inheritable trait.

54
Q

List the three selector types in order of increasing specificity.

A

Tag, Class, ID

55
Q

Why is using !important considered bad practice?

A

it interacts directly with specificity and the cascade. [ It reverses the cascade order of stylesheets, so could throw things off. ]