HTML / CSS Flashcards

1
Q

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

A

Between the head tags

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

Between the body tags

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

The head goes at the top of the HTML document. The body tag goes at the bottom of the HTML document, below the head tags

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

Declaration to tell a browser which version of HTML the page is 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

<div> <a> <img></img> <span> </span></a></div>

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

HTML attributes give additional information regarding the tag

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

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 take start on a new row and take 100% width of its parent container

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 are only as wide as their content

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

A block-level element’s width is 100% of its parents container

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

As wide as its 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 ordered numerically. Unordered list items are listed as 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

<a> anchor tag. The URL is listed with an href attribute</a>

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 contains all information necessary to locate a resource

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 points to a file relative to the current 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 directory followed by /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

Name of file in current directory or ./ 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

Allow you to collect information from visitors to your site

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

text input, radio buttons, submit buttons, checkboxes, and text area

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

type, name, size, maxlength, value, id, selected

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

Is an HTML 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, thead, tbody, tfoot, th, td.
26
What purpose do the thead and tbody elements serve?
The HTML element defines a set of rows defining the head of the columns of the table. The HTML Table Body element () encapsulates a set of table rows ( elements), indicating that they comprise the body of the table ().
27
Give two examples of data that would lend itself well to being displayed in a table.
Sports statistics and schedules
28
What are the names of the individual pieces of a CSS rule?
selector & declaration
29
In CSS, how do you select elements by their class attribute?
.class-name {}
30
In CSS, how do you select elements by their type?
element-name {}
31
In CSS, how do you select an element by its id attribute?
#class-name {}
32
Name three different types of values you can use to specify colors in CSS
RGB / RGBA, Hex code, or Named colors
33
What CSS properties make up the box model?
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?
A CSS pseudo-class is a keyword added to a selector that specifies a special state of the selected element(s). (:hover can be used to change a button's color when the user's pointer hovers over it.)
37
What are CSS pseudo-classes useful for?
Pseudo-classes let you apply a style to an element not only in relation to the content of the document tree, but also in relation to external factors like the history of the navigator (:visited, for example), the status of its content (like :checked on certain form elements), or the position of the mouse (like :hover, which lets you know if the mouse is over an element or not).
38
Name at least two units of type size in CSS.
px, %, (small, medium, large)
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?
nowrap
42
Why do two div elements "vertically stack" on one another by default?
because they are 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?
It does not change document flow
46
How does setting position: relative on an element affect where it appears on the page?
It is relative to where it normally appears on page
47
How does setting position: absolute on an element affect document flow?
It removes it from the document flow
48
How does setting position: absolute on an element affect where it appears on the page?
Position changes relative to its containing block
49
How do you constrain an absolutely positioned element to a containing block?
Make the containing box non-static
50
What are the four box offset properties?
left, right, top, bottom
51
What are the four components of "the Cascade".
Importance, inheritance, specificity, source order
52
What does the term "source order" mean with respect to CSS?
The order that your CSS rules are written in your stylesheet
53
How is it possible for the styles of an element to be applied to its children as well without an additional CSS rule?
inheritance
54
List the three selector types in order of increasing specificity.
Type, class, Id
55
Why is using !important considered bad practice?
it makes debugging more difficult by breaking the natural cascading in your stylesheets. When two conflicting declarations with the !important rule are applied to the same element, the declaration with a greater specificity will be applied.
56
What does the transform property do?
The transform CSS property lets you rotate, scale, skew, or translate an element. It modifies the coordinate space of the CSS visual formatting model.
57
Give four examples of CSS transform functions.
matrix, translate, scale, rotate, 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.
width and flex-basis
60
Which HTML meta tag is used in mobile-responsive web pages?
viewport
61
What is a breakpoint in responsive Web design?
The point at which a media query is introduced
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?
%s are better for responsiveness
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?
The style is being selected based on its position in the stylesheet