HTML & CSS- part 3 Flashcards

1
Q

How do you make the text on a page even on the left side?

A

text-align: left;

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

If you don’t specify, how does the text align by default?

A

Left side

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

By default, how much do browsers indent the first line of a paragraph?

A

They don’t indent at all by defaut.

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

What’s the code to indent a paragraph?

A

text-indent: 1em;

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

How do you set off a quotation more than a few lines long?

A

<blockquote>

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

What’s the point of a margin?

A

A margin creates extra whitespace around the top, bottom, or sides of an element.

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

How do you code a margin if you wanted: no margin on the top
2em on the right-hand side
1em on the bottom
1.75em on the left-hand side?

What order do the terms go in?

A

margin: 0 2em 1em 1.75em;

They are in clockwise order with the top listed first.

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

When writing a margin, border, etc., which is correct: 0 or 0em?

A

0 is correct

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

How do you code a margin if you only want it to affect one side?

A

Use one of these:
margin-top
margin-right
margin-bottom
margin-left

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

How do you indicate a comment in HTML?

A

<!–…–>

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

How do you indicate a comment in CSS?

A

/* This is a single-line comment */

/* This is
a multi-line
comment */
(Just like in javascript multi-line comments)

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

How do you code a border?

A

border: width style color;

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

What are a few of the styles that borders come in?

A

dotted
dashed
solid
double
groove or ridge
inset or outset

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

How do you code space between the border and the element inside of it?

A

padding: 3em;
(works just like margins, except it’s inside the border)

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

In CSS, how do you tell which properties are FONT- and which are TEXT- generally speaking?

A

TEXT- usually means you are moving the text.
FONT- think of selecting the individual letters from a tray of metal type: if you want to make it larger or italicized or bold, you’re going to need a different piece of type.

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

In CSS, what’s the point of inheritance?

A

Efficiency, less coding

17
Q

How does inheritance work?

A

Parent elements like <body> pass on their properties to their children elements like <p> <h1> or <div>. In turn, these can pass their properties on to their children, like <span></span>

18
Q

How do you overrule inheritance?

A

Set up the element’s properties explicitly:
h2 {color: black} will overrule the color that in inherited, BUT NOT any of the other properties.

19
Q

What do most developers specify for the font size in the body and why?

A

1em
All EM values in the body are based on this, so it keeps the standard neutral.

20
Q

A span within a paragraph is a child of that paragraph. If paragraphs are styled with a font-size of 1.5 ems, how many ems would a span have if you wanted to double it, and why?

A

The span would be 2em. That’s because the paragraph redefined the size of the EM. It doesn’t matter if the <p> was 1.5 times its parent’s font or half of it. Once the <p> redefines the EM, that’s all the child sees.
In other words, the EM is your parent’s standard, not the original standard.