HTML & CSS Flashcards

1
Q

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

A

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

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

<html> element
</html>

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 specific version of HTML used

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

html, head, body, title, 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 give more detail/description for 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 copyright symbol

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

start on new line and next element start on 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

can appear on the same line next to another inline 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

width = 100% of container
height = auto

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

width = auto (content)
height = auto

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

by default one is number and one is bulleted

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 element <a></a>

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

What is an absolute URL?

A

link to external sources

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

What is a relative URL?

A

link to internal sources (jump between internal files or divider)

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

../ (forward slash)

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

directory/file

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

../../

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

./ or pointing to file

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 group form elements together (boundary)

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

<form>, <input></input>, <select>/<option>, <textarea>, <button>
</button></textarea></option></select></form>

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></input> elements.

A

text, radio, checkbox, submit, password

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

Is an HTML <input></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
What are the six primary HTML elements for creating tables?
, , , , ,
,
26
What purpose do the thead and tbody elements serve?
define set of rows into either head or body
27
Give two examples of data that would lend itself well to being displayed in a table.
sport statistic & stocks info
28
What are the names of the individual pieces of a CSS rule?
selector, declaration block, declaration, property, value, rule-set
29
In CSS, how do you select elements by their class attribute?
using . (dot/period)
30
In CSS, how do you select elements by their tag name?
using tag name
31
In CSS, how do you select an element by its id attribute?
using #
32
Name three different types of values you can use to specify colors in CSS.
rgb, hex#, hsl
33
What CSS properties make up the box model?
content (width x height), padding, border, margin
34
Which CSS property pushes boxes away from each other?
margin
35
Which CSS property add space between a box's content and its border?
padding
36
What is a pseudo-class?
keyword of special state for selector
37
What are CSS pseudo-classes useful for?
can pick up very specific element or state that can be interact with the users
38
Name two types of units that can be used to adjust font-size in CSS.
rem, px, %, em
39
What CSS property controls the font used for the text inside an element?
font-family
40
CSS property with 4 sides value, which side does the first, second, third and forth value represent
top, right, bottom, left (clockwise)
41
CSS property with multiple value is called?
shorthand property
42
CSS font-family require back up value called?
fallback value
43
text-align property can be applied to inline block, block or inline element?
inline block & block elements
44
What is the default flex-direction of a flex container?
row (left-right)
45
What is the default flex-wrap of a flex container?
no-wrap
46
what does flex-flow combined?
flex-direction & flex-wrap
47
Why do two div elements "vertically stack" on one another by default?
because div is a block element
48
What is the default flex-direction of an element with display: flex?
row
49
What are the three primary components of a page layout? (Which helper classes do you need?)
container, row, column
50
What is the minimum number of columns that you should put in a row?
1
51
What is the purpose of a container?
to confine a space (specify width) where the flex-items (row & column) are placed into
52
in layout classes, what is the purpose of class=row
to give a section out of container in a vertical direction
53
in layout classes, what is the purpose of class=column
to give a section out of row in a horizontal direction
54
What is the default value for the position property of HTML elements?
position: static
55
How does setting position: relative on an element affect document flow?
it doesn't
56
How does setting position: relative on an element affect where it appears on the page?
it will appear in relative to it's original/true position
57
How does setting position: absolute on an element affect document flow?
remove from document flow entirely, doesn't affect other elements at all
58
How does setting position: absolute on an element affect where it appears on the page?
it will go within the nearest ancestor element with position non-static, if there's no non-static element, then it will base of the viewport
59
How do you constrain an absolutely positioned element to a containing block?
set it within a parent element with relative position (or other non-static positions) defined
60
What are the four box offset properties?
top, bottom, left, right
61
what does fixed position property do to block element?
striped it of block properties
62
What are the four components of "the Cascade".
Inheritance, specificity, important, source order
63
What does the term "source order" mean with respect to CSS?
the vertical order within the code file, the rule beneath another rule will govern
64
How is it possible for the styles of an element to be applied to its children as well without an additional CSS rule?
inheritance properties can be passed down without additional CSS rule on the children
65
List the three selector types in order of increasing specificity.
universal <- element <- class <- ID <- inline style <- !important
66
Why is using !important considered bad practice?
can't be overridden (top of chain)
67
What does the transform property do?
let you rotate, scale, skew or translate by modify the coordinate space of the css
68
Give four examples of CSS transform functions.
translate, rotate, scale, skew
69
The transition property is shorthand for which four CSS properties?
property_name, duration, timing-function, delay
70
Give two examples of media features that you can query in an @media rule.
min-width, max-width
71
Which HTML meta tag is used in mobile-responsive web pages?
viewport meta tag
72
What is a breakpoint in responsive Web design?
area where styling would change to new set
73
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?
would not require more breakpoints during small transition
74
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?
source order (Cascade SS)