O'Reilly logo

HTML5 Digital Classroom by AGI Creative Team, Jeremy Osborn

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Lesson 4: Introduction to CSS Layout

web07.psd

In this lesson, you will learn the fundamentals of how to create a two column, fixed-width CSS layout.

What you’ll learn in this lesson:

  • Understanding CSS reset files
  • An overview of CSS layout options
  • How to use margins and padding to add space to your pages
  • Working with the float and clear properties

Starting up

You will work with several files from the HTML5_04lessons folder in this lesson. Make sure you have loaded the HTML5lessons folder onto your hard drive from www.digitalclassroombooks.com/HTML5. See “Loading lesson files” in the Starting Up section of this book.

4139.jpg The examples in this lesson use the TextWrangler text editor to create the HTML markup, but you can use any text editor and achieve the same results.

Working with a CSS reset file

Before you start building your page layout, you will learn to use a CSS reset file. In Lesson 3, you learned that virtually all HTML elements (such as paragraphs and headings) have default styles rendered by the browser. For example, the heading 1 default style has top and bottom margins of 10 pixels. If you want to style a heading so there is no margin, you must explicitly set the style rules to zero.

On the left is a heading 1 with default margins of 10 pixels. On the right is a heading ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required