html & css Flashcards

1
Q

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

A

In the head tag

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 tag

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

Inside the HTML tag

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

Declare the type of 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

p, html, head, title, img

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

Indicates what kind of extra information you are supplying about the element’s content

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 symbol (&copy)

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 will always start 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 continue on the same line as neighboring 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

As much width as the parent div, and the height as much as the content needs

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

Only takes up as much width & height that it needs

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

An ordered list is numbered, while an unordered list is 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

Block element

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

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

What is an absolute URL?

A

A URL that will take you to the specific domain of another website

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 takes you to different pages on the same website.

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

../

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

Name of the child folder followed by a slash then the file name

music/listings.html

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 grand parent directory?

A

The name of a child folder, followed by a forward slash, then the name of the grandchild folder, followed by another slash, then the file name.

../../index.html

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

Just list the file name

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

To submit information to a server

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

Radio, Checkbox, Password input, Submit, File upload

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

Give three examples of type attributes for HTML elements.

A

text, password, radio,

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

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

A

inline element

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

What are the six primary HTML elements for creating tables?

A

table, tr, td, th, thead, tbody

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

What purpose do the thead and tbody elements serve?

A

Help distinguish between the main content of the table and the first row

27
Q

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

A

Financial reports, sport results

28
Q

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

A

selector & declaration

29
Q

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

A

.class (period)

30
Q

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

A

Use the specific element name

31
Q

In CSS, how do you select elements by its id?

A

id (hashtag)

32
Q

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

A

RGB, hex codes, some color names

33
Q

What CSS properties make up the box model?

A

Border, Margin, Padding

34
Q

Which CSS property pushes boxes away from each other?

A

Margin

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 keyword added to the selector that specifies a specific state

37
Q

What are CSS pseudo-classes useful for?

A

Allows us to modify how we select elements

38
Q

Name at least two units of type size in CSS.

A

px, em

39
Q

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

A

font-family

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

nowrap

42
Q

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

A

They are block level elements

43
Q

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

A

Row

44
Q

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

A

Static

45
Q

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

A

It doesn’t affect document flow

46
Q

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

A

Its relative to its original position

47
Q

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

A

It removes it from the document flow

48
Q

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

A

You specify the distance the element should be from each of the containing element’s sides

49
Q

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

A

Make the containing block non-static

50
Q

What are the four box offset properties?

A

Top, bottom, right, left

51
Q

What are the four components of “the Cascade”.

A

Source order, Inheritance, Specificity, Importance

52
Q

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

A

The order of your css styles in which they are written

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

Inherited properties

54
Q

List the three selector types in order of increasing specificity.

A

Type, class, id

55
Q

Why is using !important considered bad practice?

A

It breaks the natural cascading in your stylesheet and makes it hard to debug

56
Q

What does the transform property do?

A

Lets you rotate, scale, skew, or translate an element

57
Q

Give four examples of CSS transform functions.

A

rotate, scale, skew, translate

58
Q

The transition property is shorthand for which four CSS properties?

A

transition-delay, transition-duration, transition-property, transition-timing-function

59
Q

Give two examples of media features that you can query in an @media rule.

A

width, height

60
Q

Which HTML meta tag is used in mobile-responsive web pages?

A

viewport

61
Q

What is a breakpoint in responsive Web design?

A

The points at which a media query is introduced because of changes on the screen

62
Q

What is the advantage of using a percentage (e.g. 50%) width instead of a fixed (e.g. px) width for a “column” class in a responsive layout?

A

Percent’s are relative to whatever device is used

63
Q

If you introduce CSS rules for a smaller min-width after the styles for a larger min-width in your style sheet, the CSS rules for the smaller min-width will “win”. Why is that?

A

Because of CSS Cascading (priority)