HTML & CSS- part 3 Flashcards
How do you make the text on a page even on the left side?
text-align: left;
If you don’t specify, how does the text align by default?
Left side
By default, how much do browsers indent the first line of a paragraph?
They don’t indent at all by defaut.
What’s the code to indent a paragraph?
text-indent: 1em;
How do you set off a quotation more than a few lines long?
<blockquote>
What’s the point of a margin?
A margin creates extra whitespace around the top, bottom, or sides of an element.
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?
margin: 0 2em 1em 1.75em;
They are in clockwise order with the top listed first.
When writing a margin, border, etc., which is correct: 0 or 0em?
0 is correct
How do you code a margin if you only want it to affect one side?
Use one of these:
margin-top
margin-right
margin-bottom
margin-left
How do you indicate a comment in HTML?
<!–…–>
How do you indicate a comment in CSS?
/* This is a single-line comment */
/* This is
a multi-line
comment */
(Just like in javascript multi-line comments)
How do you code a border?
border: width style color;
What are a few of the styles that borders come in?
dotted
dashed
solid
double
groove or ridge
inset or outset
How do you code space between the border and the element inside of it?
padding: 3em;
(works just like margins, except it’s inside the border)
In CSS, how do you tell which properties are FONT- and which are TEXT- generally speaking?
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.
In CSS, what’s the point of inheritance?
Efficiency, less coding
How does inheritance work?
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>
How do you overrule inheritance?
Set up the element’s properties explicitly:
h2 {color: black} will overrule the color that in inherited, BUT NOT any of the other properties.
What do most developers specify for the font size in the body and why?
1em
All EM values in the body are based on this, so it keeps the standard neutral.
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?
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.