HTML & CSS Flashcards

1
Q

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

A

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

body tag

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

Where do the «a>head</a>> and «a>body</a>> tags go in a valid HTML document?

A

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 «a>!DOCTYPE</a>> declaration?

A

To let the browser know which version of HTML we’re using

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

a, p, div, body, 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

provides the element with additional information

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

& amp; (without the space)

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

takes up the entire width and moves to 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

doesn’t affect document flow. span elements will stay on the same line

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 is 100% of the available space and height is 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 and height are both 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

ordered - structured and numbered

unordered - no structure and no numbers. 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

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

«a>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

url to external page

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

What is a relative URL?

A

url to something on the same page

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 forward slash, then the file name

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

just use 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 receive input from a user and make a webpage interactive. also the form element itself hold and contains all the form control elements

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

input, textarea, select, option, button

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

A

radio, checkbox, submit

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

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

A

inline

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?
table, tr, td, thead, tbody, tfoot
26
What purpose do the thead and tbody elements serve?
thead - the heading for the tables | tbody - the main content and meat of the table
27
Give two examples of data that would lend itself well to being displayed in a table.
sports graphs, anything that should be in an excel document
28
What are the names of the individual pieces of a CSS rule?
declaration block, selectors, property, and value
29
In CSS, how do you select elements by their class attribute?
with a .
30
In CSS, how do you select elements by their type?
just write out the element
31
In CSS, how do you select an element by its id attribute?
with a #
32
Name three different types of values you can use to specify colors in CSS.
hex codes, RGB values, and a color name
33
What CSS properties make up the box model?
margin, padding, border
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?
classes that are applied based on a certain state
37
What are CSS pseudo-classes useful for?
It can be combined with a CSS selector to add an effect to existing elements based on their states
38
Name at least two units of type size in CSS.
pixel and em
39
What CSS property controls the font used for the text inside an element?
font-family
40
What is the default flex-direction of a flex container?
row
41
What is the default flex-wrap of a flex container?
no wrap
42
Why do two div elements "vertically stack" on one another by default?
divs are by default block elements
43
What is the default flex-direction of an element with display: flex?
row
44
What is the default value for the position property of HTML elements?
static
45
How does setting position: relative on an element affect document flow?
no document flow
46
How does setting position: relative on an element affect where it appears on the page?
does not change document flow
47
How does setting position: absolute on an element affect document flow?
completely takes it out of document flow
48
How does setting position: absolute on an element affect where it appears on the page?
within the nearest non-static element
49
How do you constrain an absolutely positioned element to a containing block?
set it to something other than static
50
What are the four box offset properties?
top, right, bottom, left
51
What are the four components of "the Cascade"?
source order, specificity, inheritance, and !important (important rule)
52
What does the term "source order" mean with respect to CSS?
styling that is lower in the style sheet takes precedence over what's higher in the style sheet
53
How is it possible for the styles of an element to be applied to its children as well without an additional CSS rule?
condition where child elements can use styling elements from parents elements
54
List the three selector types in order of increasing specificity.
type < class < ID
55
Why is using !important considered bad practice?
!important always wins
56
What does the transform property do?
rotate, skew, scale, etc on the coordinate space
57
Give four examples of CSS transform functions.
rotate, translate, scale, skew
58
The transition property is shorthand for which four CSS properties?
transition-property, transition-duration, transition-timing-function, and transition-delay.
59
Give two examples of media features that you can query in an @media rule.
min-width & max-width
60
Which HTML meta tag is used in mobile-responsive web pages?
<meta name="viewport" content="width=device-width, initial-scale=1">
61
What is a breakpoint in responsive Web design?
point where our styling would break
62
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?
with percentages the layout adapts to the exact dimensions of the viewport's width.
63
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?
bottom one wins due to source order.