What does HTML stand for?
Hypertext Markup Language
What does CSS stand for?
Cascading Style Sheets
Everything in a website is a _____
A box!
Name two different display property values
block, inline, inline-block
How many brothers do I have? Bonus if you remember what number I am.
What is the difference between the head and the body tags?
head is for meta-information about the webpage
body is for the content that you see
In the example below, what is the term for "p" and what is the term for "color: white;"?
p { color: white; }
p is a selector
color:white; is a property
What is the box-model property that adds space inside the border?
What is the tag used to connect an HTML file with a CSS file? Bonus points if you can write out the syntax.
The link element.
<head>
<link rel="stylesheet" href="styles.css">
</head>
What is the syntax for selecting an element with a class of "red"?
.red {}
Draw and label the box model
Suppose you wanted to make a navigation bar with buttons in a row. What display property would you use?
inline-block
When structuring a website, we should be thinking in terms of _____ and _____ .
Rows and Columns
What is the syntax for creating a paragraph with the text "hello world" and a class of "red"?
`<p class='red'>hello world</p>`
The default text color of a document is black.
Imagine you have a div with a paragraph inside. The div has the `color: white;` property set.
What will the color of the paragraph be and why?
Also white because it inherits the color from its parent.
How do you center a div within a container?
Imagine you have a row that is 700px wide and it has two inline-block elements that are each 400px wide. What will happen?
Bonus: How do you ensure two elements in a row ALWAYS fit?
The second element will go onto its own line.
Bonus: You can use percent units that equal 100%
What direction will a box with the following properties be move?
And what is its position relative to: relative to the body, relative to its parent, or relative to its original position?
.box { position: relative; top: 100px; left: -100px }
The box will move down and to the left. It will be relative to its original position.
Label the diagram using semantic tags
Header, main, footer, aside
What will be the resulting background color of the element assuming that all of the selectors apply?
.box { background: red; }
div { background: blue; }
div.box { background: purple; }
Purple! The div.box selector is the most specific.
What is the difference between box-sizing: content-box and box-sizing: border-box?
(It's okay if you don't remember which is which)
box-sizing: content-box is the default. It calculates the total size of an element by adding width, height, padding, and border.
box-sizing: border-box calculates the total size of an element to equal the width/height properties. Padding and border push the content inward.
Inline-block elements will have a tiny space between them. If we want to create a row of elements that are right next to each other, what can we do?
We can wrap the elements in a container and use float.
What is the difference between `em` and `rem` units?
ems are based on the parent font size
rems are based on the root (html) font size