Lesson 4: Introduction to CSS Layout
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.
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.
Get HTML5 Digital Classroom now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.