Skip to Main Content
HTML5 Digital Classroom
book

HTML5 Digital Classroom

by Jeremy Osborn, AGI Creative Team
October 2011
Intermediate to advanced content levelIntermediate to advanced
448 pages
10h 15m
English
Wiley
Content preview from HTML5 Digital Classroom

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Sams Teach Yourself CSS 24 in Hours

Sams Teach Yourself CSS 24 in Hours

Kynn Bartlett

Publisher Resources

ISBN: 9781118128770Purchase bookOther