Now for the CSS. We need to create the ID for the footer and give it formatting. #footer { bottom: 0; position: absolute; background-color: #cfc; color: #000; width: 80%; text-align: center; padding: 2% 10%; } Now to explain the code: bottom: 0; This places the div at the bottom of the page. The value is the distance from the bottom. This could be a value using px, % or em. In this case we are using 0 to make it stuck to the bottom of the browser, unless you have a margin set for your body. position: absolute; This makes sure that the footer is at the very bottom and makes its position stick. background-color: #cfc; This sets the background of the div. In this case it is a nice web friendly green. The full hex would be #ccffcc. color: #000; This sets the text color. In this case black. width: 80%; This sets the width. Now you will see in the example here that the footer takes up 100%. This is because IE needs it to say 80% as it assumes that the width excludes any padding or margins or borders. I will explain this in more detail later on. text-align: center; This centers the text within the div. padding: 2% 10%; This adds padding within the div. The first number is the Top and Bottom padding, the second number is the Left and Right padding. You can give different values to each of the top, right, bottom and left. |