Brett Haymaker, JavaScript Consultant & Instructor
15 MINUTES
Review the site below:
http://www.danielspatzek.com
Draw the DOM Tree for web pages containing <div> & <section>.
Apply header, footer, sidebar, and multi-column layouts to develop a web page.
Experiment and predict effects of floats and clearing CSS positioning.
Originally, the float property was introduced to allow web developers to implement simple layouts involving an image floating inside a column of text, with the text wrapping around the left or right of it.
The float style property takes 1 of three properties:
Since floats were never really meant for the job of building out layouts to begin with, they cause really strange things to happen.
When we use float, we must "clear" the float afterwards.
When we clear, we restore the natural layout of the page. The calculated height of floated items is technically 0. Because of this, any margin we apply to sibling elements will be ignored.
Let's take a look at an example using header, footer, sidebar, etc.
There are a number of ways to do this.
First, let's build our markup.
50 Minutes
I will slack out a number of layouts.
You'll have 50 minutes of class time (at least) to practice implementing these layouts using float and clear.
Create a new directory, styles.css and index.html file for each layout.
Class name: FEWD 17