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



Welcome to Core CSS. Though Cascading Style Sheets (CSS) have been around for a few years now, it is still underutilized on the Web. The original CSS specification was released by the World Wide Web Consortium back in December of 1996. Since then both Microsoft and Netscape have been slow to implement CSS fully in their respective browsers, and at the time of writing (November 1999) neither the current versions of Internet Explorer nor Netscape Navigator implement CSS fully. Despite this, there are real signs that there is a real drive to make CSS a critical part of Web design in the near future. Browser manufacturers like Opera have pushed for full CSS compatibility, and Netscape has made real efforts to incorporate CSS1 fully and parts of CSS2 into Mozilla, the "precursor" browser to the final release of what will one day become Netscape Navigator 5.0.

Web authors are beginning to realize that CSS provides the power they have been asking for in order to have greater control over how things appear and work on screen. Part of being able to use this power is to understand how it all works. That's where this book comes into the picture.

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. If you fit either of these circumstances, then this book is for you.

Arguably one of the reasons why CSS has not been adopted as quickly as many other Web technologies have been is the lack of good, solid information as to how it should work. There is also a wide disparity between how CSS is supposed to work, and how it actually works in the major browsers.

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 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 what 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 CSS2. CSS2 is a relatively recent specification that takes the original CSS specification further, bringing the Web to new display devices, providing much greater control over the positioning of onscreen elements, even providing Web authors with the control as to how Web pages should sound and much more. Browser support for CSS2 is limited at the moment, but it promises to come to the fore in the near future. This book provides the Web author with a guide as to what to expect when CSS2 is widely implemented.

You do not have to be an expert at understanding how the Hypertext Markup Language (HTML) works, 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 should stand in good stead as a handy reference for those occasions when you need to look up how a particular CSS property works.

How This Book Is Organized

This book is divided into three parts, with a number of appendices designed to provide the Web author with quick reference material to have on hand when writing CSS code.

Part One, "The Origins of Cascading Style Sheets" , begins by looking at how HTML developed, and the "browser wars" that necessitated the need for Cascading Style Sheets, in an attempt to rein in the burgeoning number of HTML tags unleashed onto Web authors by Microsoft and Netscape. It also looks at the role of the World Wide Web Consortium and the underlying goals behind the development of the first CSS specification. The relationship between HTML and CSS is then explored, looking at the ways in which CSS code can be incorporated into Web pages using such HTML tags as <STYLE>, <SPAN>, <DIV> and <LINK> and the HTML attributes STYLE, CLASS and ID. The concept of "cascading" is also explained in brief with its many rules plainly laid out. The final chapter in this part looks at how CSS is actually implemented in various releases of the major browsers.

Part Two, "CSS1" , is devoted wholly to explaining all of the properties belonging to the CSS1 specification in detail. At the same time, the practical uses for each CSS1 property are also emphasized, along with code examples and information explaining any known quirks as to how (or if) a specific CSS1 property's functionality is implemented in a current browser. This part is bro- ken down into nine chapters, each exploring a section of the CSS1 specification and its properties. The first four chapters explore some CSS fundamentals and how well they work in current browsers. Chapter 5 ("Implementation of Basic CSS Concepts") and Chapter 6 ("The Cascade") look at how well these basic concepts (such as inheritance, grouping CSS code and cascading rules) are implemented in the major browsers. Chapter 7 ("CSS Units") looks at and explains the many different fundamental units of measure that can be used in conjunction with certain CSS properties. The remaining chapters in this part proceed to cover the CSS1 properties and their functionality in detail. Chapter 8 ("Pseudo-Classes and Pseudo-Elements") looks at how pseudo-classes and pseudo-elements can be utilized. Chapter 9 ("Font Properties") looks at the many font-related properties in detail, explaining how they can be used to precisely lay out the type of font display to be seen by the user. Chapter 10 ("The Color and Background Family of Properties") examines how the versatile family of COLOR and BACKGROUND properties can be used effectively. Chapter 11 ("The Text Family of Properties" ) discusses how the many text-related CSS properties can be used to control how text is displayed onscreen. Chapter 12 ("The Box Family of Properties") explains and examines the box set of CSS properties, which determine how a wide variety of Web elements such as headers, images and paragraph can have their appearance enhanced. Finally, Chapter 13 ("The Classification Family of Properties") looks at those properties designed to fundamentally alter the way in which certain onscreen elements are to be displayed within the browser.

Part Three, "CSS2" , examines how the properties of this relatively recent specification are to be used. The CSS2 specification is meant as an additional standard built on top of the CSS1 specification, and is meant to be an adjunct to it. Since many of the properties in the CSS2 specification are already defined and explained in Part Two, only those properties that are wholly new to CSS2 are covered. This part is broken down into a total of 14 chapters. As with the previous part, the first three chapters of this part are devoted to some CSS2 fundamentals. The first chapter ("Overview") provides a concise summary of the new features introduced under the CSS2 specification. Chapter 15 ("Selectors, Pseudo-Elements and Pseudo-Classes") looks at the powerful new selectors, pseudo-elements and pseudo-classes that are available for use. Chapter 16 ("New Media Types") introduces the concept of media types, and examines how Web pages can be modified so that they can be displayed in other media such as print or "talking browsers". All of the remaining chapters of this part look in turn at all of the new or significantly enhanced CSS properties. Chapter 17 ("The Box Family of Properties") looks at the important changes made to this important family of properties as well as the many new properties that are introduced under the CSS2 specification. Chapter 18 ("Visual Formatting Family of Properties") peers at the properties comprising this new family of functions that gives Web authors much greater control over how things appear onscreen. Chapter 19 ("Detailed Visual Formatting Family of Properties") deals with those properties that are meant to handle the fine details in the display of many onscreen elements. Chapter 20 ("Visual Effects Properties") looks at those properties designed to enable Web authors to control how text or other Web elements are displayed when they exceed the dimensions of the box within which they are contained. Chapter 21 ("Generated Content, Automatic Numbering and Lists") explains how the new functions that are provided with CSS2 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 22 ( "Paged Media Family of Properties") explores those elements related to crafting Web pages so that they can be printed in the precise way that a Web author desires. Chapters 23 and 24 ("Font Family Properties" and "Text Family Properties") look at those new and expanded properties introduced under CSS2 to the font and text families of properties respectively. Chapter 25 ("Table Family Properties") looks into this new class of properties that provide greater control over how tables should be displayed onscreen. Chapter 26 ("User Interface Properties") examines another new class of properties designed to provide greater control over the display of such things as cursors and the outlines that surround such things as buttons or text fields in forms that denote a "focus" for user input. The final chapter, Chapter 27 ("Aural Style Sheet Properties"), explores a 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.

There are a number of appendices that are designed as a quick reference for Web authors who need to look up how a particular CSS property functions, and whether or not it is supported in the major browsers. Appendix A is devoted to an alphabetical listing of all CSS1 properties, their values, plus sample code and whether or not it is supported in the major browsers. Similarly, Appendix B is an alphabetical listing of all CSS2 properties and their values plus sample code demonstrating how each property is to be used. Appendix C looks briefly at all of the ways colors can be implemented in CSS, as well as the ways various units of measure, percentage units and URLs can be used.

There is also a set of color-coded charts detailing those CSS1 properties and functions that have and have not been adopted within the various versions of the major browsers. These are designed as "spot" guides to tell a Web author whether or not a particular CSS1 property is "safe" to use. There are three such color charts: the first lists only the "safe" CSS1 properties, the second lists only the "unsafe" CSS1 properties and the final chart displays all CSS1 properties, "safe" and "unsafe".

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 some 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 that the reader should be alerted to:


This is information that deserves special attention, such as an interesting fact about the topic at hand, or that the reader may want to keep in mind.


This is information that, while useful, may cause unexpected results or serious frustration.


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 processes were already set in motion to produce an official specification for CSS3, but were in too early a state to be covered effectively in this book. 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 are Netscape and Microsoft. You can find out more about the latest CSS developments in Netscape Navigator by going to Netscape's home page at:


You can find out more information about how CSS can be used with Microsoft's Internet Explorer from Microsoft's Internet Explorer Web site at:


(A minor caveat—to the annoyance of many, Microsoft is well known for frequently changing the URLs of major sections of their Web site. If this URL does not work, try going to the Microsoft home page at http://www.microsoft.com and begin looking for links about Internet Explorer).

It is also worth pointing out where to find information about the two other browsers referenced in this book, both of which (at the time of writing) incor porate more CSS functionality than either Netscape Navigator or Internet Explorer. Both of these browsers would make for good additions to a Web master's "toolbox" when checking whether your CSS code functions the way you want it to. Opera is a browser that almost fully understands all CSS1 code, and more information about it can be found from Opera Software's Web site at:


Mozilla is a project of Netscape Corporation to produce a browser incorporating open standards such as CSS. The latest version of their browser understands CSS1 and a major portion of CSS2. It is fully expected by many to lay the groundwork for the much-anticipated Netscape Navigator 5.0. More information about the Mozilla browser can be found at:


For people seeking more information as to how CSS can be used, there is a single Usenet newsgroup wholly devoted to the subject that is well worth checking out:



No book is perfect and this one is unlikely to be an exception to that rule. Even though it has been through a long period of revision and technical review, there are, of course, errors still to be found and improvements still to be made. If you find an error or if there is something that you think might make the book more useful, we want to know about them. Please send comments and corrections to the following e-mail address:


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