• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL



Welcome to the second edition of Core CSS. When the initial edition came out in 2000, while CSS had been around for a few years, it was largely underutilized on the Web. And there was a good reason for this: browser support for CSS properties was, to put it kindly, “spotty.” In the past few years things have changed substantially: the Mozilla project pushed for a standards-compliant rendering engine — including CSS — that has since been incorporated into the most recent versions of Netscape Navigator; and Internet Explorer 5.0 and later 6.0 made real advances in supporting CSS properties. As older, non-CSS-compliant browsers fade into the background, Web design has advanced accordingly and is beginning to take full advantage of the formatting possibilities that CSS opens up for both eye-popping and better functioning Web sites.

While the browser manufacturers have been playing “catch-up” and have largely (with some notable exceptions) instituted the CSS1 and CSS2 standards devised by the World Wide Web Consortium (W3C), the W3C has not stood still. While still in draft status, the various modules that will one day comprise the CSS3 specification are well on the way towards providing a comprehensive set of tools for Web authors seeking to format just about anything and everything you can think of that has to do with a Web page. While none of these CSS3 modules have been finalized — and things may still change substantially — many of the new directions that are being charted by the W3C in this area are covered in this book as a “heads up” as to what future Web developers can come to expect.

One of the original reasons behind the creation of CSS was to prevent competing browsers developers from the runaway development of new HTML tags that only worked in their particular browser. This has seemingly not stopped the temptation by browser manufacturers to continue to “push the envelope,” and in particular, recent versions of Microsoft's Internet Explorer have included a number of browser-specific CSS properties. These are covered in the various sections of the book, both out of a sense of completeness as well as wanting to provide readers who may be working in a “closed-shop” environment (i.e., where they know that their clients are all using this browser) with information they can genuinely use. As a member of the W3C, Microsoft is also helping to chart the progress of the future CSS development, and many as yet browser-specific CSS properties may not be so in the future.

When I am asked why I write computer books, I usually respond that I write books I wished already existed that I could use daily in my work. A number of books have appeared since the first edition of Core CSS came out, but none of them have been as comprehensive — especially when it came to covering CSS2 or Internet Explorer properties — as I would have liked. The majority of the code in the first book has been completely re-written for this edition, and dozens more examples better show what particular CSS properties can do and how they work — or do not work — in modern browsers.

Who You Are

You are a Web author who is looking to expand the capabilities of your Web pages. You know that CSS opens the doors to a wide range of possibilities, but want to learn more about how to make the most of it. Or perhaps you know that CSS will solve some of your most pernicious Web formatting problems, but shy away from using it because you have heard that it can produce varying results when viewed under different browsers or under different operating systems. Maybe you are looking for a single source that tells you what you need to know about a property at a glance, instead of having to traverse a dozen Web sites to get the same information. If you fit any of these circumstances, then this book is for you.

This book takes a practical, pragmatic look at the current state of affairs regarding CSS and guides the reader through how CSS works. This book provides the information Web authors need in order to understand not only how CSS should work, but also how it actually works in current major browsers. It does not confine itself only to one operating system, but takes a look at how CSS works under browsers working under multiple operating systems. With this knowledge, Web authors will know which CSS properties are “safe” for use, and which to avoid.

More than that though, this book also provides information as to the future of CSS with an in-depth look at what will likely prove to be the foundation of the future CSS3 specification.

You do not have to be an expert at understanding how Web pages work, but the book does assume you have a basic understanding of both HTML and the Web. The book assumes no prior knowledge of CSS. It will not only serve those Web authors who are just starting out using CSS, but also act as a handy reference for those occasions when you need to look up how a particular CSS property works.

How This Book Is Organized

The first edition of this book separated CSS1 and CSS2 properties. Now that much of CSS2 has been adopted within the major browsers, it no longer made sense to keep things separate. This has been extended further to include draft CSS3 properties into the (sometimes rough) families of properties to which they belong. While these properties are not currently in use — and some of them may not end up looking the same as they do in this book when they are finally released — they are important as an indicator of the way CSS development is progressing, so that forward-looking Web authors can get a heads up. The CSS3 properties outlined here are my “best guesses” based on my own Web-authoring experience. In some cases there are wholly separate chapters devoted to Internet Explorer-only CSS properties, but many of them fall into already-defined families of properties and are included in those chapters. In addition to all of the chapters in this book are some appendices designed to provide the Web author with quick reference material to have on hand when writing CSS code.

Chapter 1 (“The Birth of CSS”) explores how CSS in its current form came to be. The following two chapters (Chapter 2, “(X)HTML and Its Relationship to CSS” and Chapter 3, “Browser Adoption of CSS”) provide information on how CSS can be accessed within Web page code, and how the major browser manufacturers have increasingly adopted CSS within their browsers. Chapter 4 (“Implementation of Basic CSS Concepts”) looks at how some of the basic concepts behind CSS — such as inheritance, grouping CSS code and cascading rules — are implemented in the major browsers. Chapters 5 and 6 (“The Cascade” and “CSS Units,” respectively) extend this concept further by looking at how the “C” of “CSS” works, and explains the many different fundamental units of measure that can be used in conjunction with certain CSS properties. Chapter 7 (“Pseudo-Classes and Pseudo-Elements”) looks at how these CSS elements which allow for special or conditional types of formatting can be utilized. Chapter 8 (“Media Types and Media Queries”) introduces the concept of media types and examines how Web pages can be modified so that they can be displayed through such things as print or “talking browsers.”

Chapters 9 and 10 (“Font Properties” and “Text Properties”) begin the “meat and potatoes” part of the book for most readers, looking in detail at the properties used daily by an increasing number of Web authors. Chapter 11 (“Text Property Extensions”) is the first chapter devoted wholly to Internet Explorer-specific properties, most of which are aimed at formatting Web pages for an international audience. Chapter 12 (“Box Properties”) brings us back to the “meat and potatoes” area of CSS formatting, explaining in detail the box set CSS properties, which can determine how a wide variety of Web elements such as headers, images and paragraphs can be enhanced. The topic of Chapter 13 (“Color”) used to be part of the background family of properties, but the draft CSS3 module has charted a new course for using color on the Web, all of which is looked at in this section. Background properties — including a number of draft CSS innovations in this area — are covered in Chapter 14 (“Background Properties”).

Chapter 15 (“Classification Properties and Generated/Automatic Content”) is the start of what for many readers will be the more esoteric uses to which CSS can be put to, and yet represents much of where the real rendering power behind CSS lies. This chapter looks at how its functions enable Web authors to control and enhance content that is automatically generated by the browser, including such things as the numbering and display of lists. Chapter 16 (“Visual Formatting and Detailed Visual Formatting”) represents the core of what is popularly known as the “CSS positioning” properties. Chapter 17 (“Visual Effects”) looks primarily at properties designed to produce stunning effects using dynamic code. Chapter 18 (“Paged Media”) explores those properties related to crafting Web pages so that they can be printed (rather than displayed on a screen) in the precise way that a Web author desires. Chapter 19 (“Tables”) looks at the somewhat rag-tag collection of table-related formatting properties, but then rounds off the chapter by looking at ways of creating table-like formatting structures using only CSS. In addition to covering what is already possible to do with user-interface properties in Chapter 20 (“User Interface”) — such as providing greater control over the display of such things as cursors and the outlines that surround buttons or text fields in forms that denote a “focus” for user input — it also includes an extensive preview as to how you can affect the functionality of Web pages when now-draft CSS3 properties become available. Mastering the properties covered in these sections guarantees that you will be at the forefront of CSS-based Web design.

Chapter 21 (“Aural Cascading Style Sheets”) begins a section of the book covering either under-implemented CSS properties or those specific to working with a particular browser. This chapter explores a relatively new class of properties designed to enable the Web author to determine how a Web page could be spoken aloud by a browser with speech capabilities — sadly, this is poorly implemented in the major browsers. Chapter 22 (“Ruby”) looks at the properties used in formatting a particular type of Chinese text layout; these properties are specific to Internet Explorer but are now being actively considered by the W3C for inclusion in the future CSS3 specification. Columnar layout properties, based in part on some old browser-specific HTML tags in Netscape Navigator, are explored in Chapter 23 (“Multi-Column Layout”). Chapter 24 (“Scrollbars”) briefly looks at some properties designed to change the appearance of scrollbars specific to recent versions of Internet Explorer. The final chapter (Chapter 25 “Filters and Transitions”) is a sizable one devoted to Internet Explorer's CSS-based way of adding some interesting and often dynamic visual effects.

Appendix A is a CSS compatibility chart, looking at all of the “Safe,” “Unsafe” and “Partial”-ly implemented CSS1 and CSS2 properties for various versions of the browsers Web authors are likely to run into. Appendix B provides an alphabetical listing of all CSS1, CSS2 and Internet Explorer CSS properties (minus the admittedly oddball filter and transition properties) as a quick reference. Appendix C looks at the CSS3 Mobile Profile and contains properties that are expected to be implemented in scaled-down browsers intended for use while “on the go.”

Conventions Used in This Book

Courier font is used to indicate HTML code, both in the listings and in the shorter code extracts that you'll find included in the text. The same font is also used to indicate HTML tags and CSS property names (such as background-color). In a few cases, we show a code extract and then explain how to modify it to change its behavior. In this case, the code that is added or modified is shown in bold courier font.

Icons are used to call out material that is of significance and to which the reader should be alerted:

Core Tip

Tip: This is particularly useful information that will save the reader time, highlight a valuable programming tip, or offer specific advice on increasing productivity.

Further Information

CSS is an ever-evolving subject. At the time of writing, the CSS3 specification was still very much in draft status, and I was writing against an ever-moving target. The definitive place to find information about CSS is the extensive material devoted to the official specifications that can be found at the World Wide Web Consortium's Web site, which can be found at:


It is also a good idea for any Web master to keep abreast of the latest developments in browser technology. The two acknowledged major players in the industry (for both Mac and PC) are Microsoft and Netscape. You can find out more about the latest developments and releases of Microsoft's Internet Explorer at:


Similarly, you can find out more about Netscape Navigator by going to Netscape's home page at:


Mozilla is an offshoot project of Netscape Corporation that was charged with the mission of producing a browser incorporating open standards such as CSS. The latest version of their browser understands CSS1 fully, as well as much of CSS2. Keeping tabs on this browser is important as it has laid the groundwork upon which subsequent versions of Netscape Navigator (so far, versions 6.x and 7.x) have been based. More information about the Mozilla browser can be found at:


Microsoft and Netscape are not the only two browsers out there. While keeping several versions of their browsers on your system is handy for testing purposes, you should also think about adding other browsers to you Webmaster's “toolbox” when checking whether your CSS code functions the way you intend it to. Foremost of these “other” browsers is Opera, which has repeatedly led the way in adopting the latest developments from the CSS specifications. You can find out more information about Opera from the Opera Software Web site at:


If you are using Linux as an operating system, you have two main choices when it comes to Web browsers: either the Linux version of Netscape Navigator/Mozilla, or Konqueror, which is included as part of the KDE desktop environment. This browser correctly renders most of CSS1 and much of CSS2. More information about this browser — which is unavailable under MS-Windows, can be found at:


Additional Material

A Web site has been created containing all of the example code from this book. If you are looking to grab a working code example or to find out the latest browser compatibility information, please visit the following site:



No computer book is perfect and this book is unlikely to be an exception to that rule. Even though this book has been subject to a long period of revision and technical review, there are bound to be errors and other places where improvements could be made. If you find an error or if there is something that you think might make the book more useful, please send an e-mail to the author at the following e-mail address:


  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint