Synopses & Reviews
As the industry standard method for enriching the presentation of HTML-based web pages, Cascading Style Sheets (CSS) allow you to give web pages more structure and a more sophisticated look. But first, you have to get past CSS theory and resolve real-world problems.
For those all-too-common dilemmas that crop up with each project, CSS Cookbook provides hundreds of practical examples with CSS code recipes that you can use immediately to format your web pages. Arranged in a quick-lookup format for easy reference, the second edition has been updated to explain the unique behavior of the latest browsers: Microsoft's IE 7 and Mozilla's Firefox 1.5. Also, the book has been expanded to cover the interaction of CSS and images and now includes more recipes for beginning CSS users. The explanation that accompanies each recipe enables you to customize the formatting for your specific needs. With topics that range from basic web typography and page layout to techniques for formatting lists, forms, and tables, this book is a must-have companion, regardless of your experience with Cascading Style Sheets.
Synopsis
""CSS Cookbook"" provides hundreds of practical examples with CSS code recipes that readers can use immediately to format their Web pages. Arranged in a quick-lookup format for easy reference, this second edition has been updated to explain the unique behavior of the latest browsers.
About the Author
Christopher Schmitt is the founder of Heat Vision, a small new media publishing and design firm, based in Cincinnati, OH. An award-winning web designer who has been working with the Web since 1993, Christopher interned for both David Siegel and Lynda Weinman in the mid 90's while he was an undergraduate at Florida State University working on a Fine Arts degree with an emphasis on Graphic Design. Afterwards, he earned a Masters in Communication for Interactive and New Communication Technologies while obtaining a graduate certificate in Project Management from FSU's College of Communication.
He is the author of CSS Cookbook, which was named Best Web Design Book of 2006, and one of the first books that looked at CSS-enabled designs, Designing CSS Web Pages (New Riders). He is also the co-author of Adapting to Web Standards (New Riders), Professional CSS (Wrox), Photoshop in 10 Steps or Less (Wiley) and Dreamweaver Design Projects (glasshaus) and contributed four chapters to XML, HTML, and XHTML Magic (New Riders). Christopher has also written for New Architect Magazine, A List Apart, Digital Web and Web Reference.
He is the list moderator for Babble, a mailing list community devoted to advanced web design and development topics. With the Web Standards Project, Christopher helps co-lead the Adobe Task Force while contributing to its Education Task Force.
On his personal web site, Christopher shows his true colors and most recent activities. He is 6'7" and doesn't play professional basketball but wouldn't mind a good game of chess.
Table of Contents
Dedication; Preface; Audience; Assumptions This Book Makes; Contents of This Book; Conventions Used in This Book; Using Code Examples; How to Contact Us; Safari Enabled; Acknowledgments; Chapter 1: General; Introduction; Using CSS with HTML; Using Different Selectors to Apply Styles; Determining When to Use Class and ID Selectors; Understanding CSS Properties; Understanding the Box Model; Understanding DOCTYPES and Effects on Browser Layout; Associating Styles to a Web Page; How to Use Different Types of Style Sheets; Adding Comments Within CSS; Organizing the Contents of a Style Sheet; Organizing Style Sheet Files; Working with Shorthand Properties; Setting up an Alternate Style Sheet; Using Floats with Images; Using Absolute Positioning; Using Relative Positioning; Using CSS in Adobe Dreamweaver; Using CSS in Microsoft Expression Web Designer; Chapter 2: Web Typography; Introduction; Specifying Fonts; Specifying Font Measurements and Sizes; Gaining More Control over Font Sizes; Enforcing Font Sizes; Centering Text; Setting Text to Be Justified; Removing Space Between Headings and Paragraphs; Setting a Simple Initial Cap; Setting a Larger, Centered Initial Cap; Setting an Initial Cap with Decoration (Imagery); Creating a Heading with Stylized Text; Creating a Heading with Stylized Text and Borders; Stylizing a Heading with Text and an Image; Creating a Pull Quote with HTML Text; Creating a Pull Quote with Borders; Creating a Pull Quote with Images; Setting the Indent in the First Line of a Paragraph; Setting the Indent of Entire Paragraphs; Creating a Hanging Indent; Styling the First Line of a Paragraph; Styling the First Line of a Paragraph with an Image; Creating a Highlighted Text Effect; Changing Line Spacing; Adding a Graphic Treatment to HTML Text; Placing Shadow Behind Text; Adjusting the Spacing Between Letters and Words; Chapter 3: Images; Introduction; Placing a Border Around an Image; Removing Borders Set on Images by Default in Some Browsers; Setting a Background Image; Creating a Line of Background Images; Placing a Background Image on a Web Page; Using Multiple Background Images on One Selector; Creating a Stationary Background Image; Overlaying HTML Text on an Image; Replacing HTML Text with an Image; Replacing HTML Text with Flash Text; Using Multiple PNGs with Transparency; Building a Panoramic Image Presentation; Combining Different Image Formats; Rounding Corners with Fixed-Width Columns; Rounding Corners (Sliding Doors Technique); Rounding Corners (Mountaintop Technique); Rounding Corners with JavaScript; Placing a Drop Shadow Behind an Image; Placing a Smooth Drop Shadow Behind an Image; Making Images Scalable; Making Word Balloons; Hindering People from Stealing Your Images; Inserting Reflections on Images Automatically; Using Image Sprites; Chapter 4: Page Elements; Introduction; Eliminating Page Margins; Coloring the Scrollbar; Techniques for Centering Elements on a Web Page; Placing a Page Border; Customizing a Horizontal Rule; Adding a Lightbox; Chapter 5: Lists; Introduction; Changing the Format of a List; Writing Cross-Browser Indentation in Lists; Place Dividers Between List Items; Creating Custom Text Markers for Lists; Creating Custom Image Markers for Lists; Inserting Large Custom Image Markers for Lists; Making a List Presentation Rich with Imagery; Creating Inline Lists; Making Hanging Indents in a List; Moving the Marker Inside the List; Chapter 6: Links and Navigation; Introduction; Removing Underlines from Links (and Adding Other Decorations); Changing Link Colors; Changing Link Colors in Different Sections of a Page; Placing an Icon at the End of the Link; Changing Cursors; Creating Rollovers Without JavaScript; Creating Text Navigation Menus and Rollovers; Building Horizontal Navigation Menus; Building a Navigation Menu with Access Keys; Creating Breadcrumb Navigation; Creating Image-Based Rollovers; Creating Collapsible Menus; Creating Contextual Menus; Making Tool Tips with the Title Attribute; Designing a Dynamic Visual Menu; Apply Styles Dynamically to a Web Page; Chapter 7: Forms; Introduction; Modifying the Spacing Around a Form; Setting Styles for Input Elements; Applying Different Styles to Different Input Elements in the Same Form; Setting Styles for textarea Elements; Setting Styles for Select and Option Elements; Creating a Macintosh-Styled Search Field; Styling Form Buttons; Creating an Image Submit Button; Setting Up a Submit-Once-Only Button; Creating a Submit Button That Looks Like HTML Text; Making an HTML Text Link Operate Like a Submit Button; Designing a Web Form Without Tabbbbbbles; Designing a Two Column Form Without Tables; Highlighting Form Fields; Integrating Form Feedback with a Form; Styling Access Keys in Web Forms; Grouping Common Form Elements; Entering Data into a Form Like a Spreadsheet; Sample Design: A Login Form; Sample Design: A Registration Form; Chapter 8: Tables; Introduction; Setting the Cell Spacing; Setting the Borders and Cell Padding; Setting the Style for Caption; Setting the Styles Within Table Cells; Setting Styles for Table Header Elements; Removing Gaps from Images Placed in Table Cells; Eliminating Gaps Between Table Cells; Creating Alternating Background Colors in Table Rows; Adding a Highlighting Effect on a Table Row; Sample Design: An Elegant Calendar; Chapter 9: Page Layouts; Introduction; Building a One-Column Layout; Building a Two-Column Layout; Building a Two-Column Layout with Fixed-Width Columns; Creating a Flexible Multicolumn Layout with Floats; Creating a Fixed-Width Multicolumn Layout with Floats; Creating a Flexible Multicolumn Layout with Positioning; Creating a Fixed-Width Multicolumn Layout with Positioning; Using Floats to Display Columns in Any Order; Designing an Asymmetric Layout; Chapter 10: Print; Introduction; Creating a Printer-Friendly Page; Making a Web Form Print-Ready; Displaying URIs After Links; Inserting Special Characters Before Links; Sample Design: A Printer-Friendly Page with CSS; Chapter 11: Hacks, Workarounds, and Troubleshooting; Introduction; Isolating Styles for Netscape Navigator 4.x; Delivering Specific Styles to Internet Explorer 5.x for Windows; Removing Web Page Flicker in Internet Explorer 5.x for Windows; Keeping Background Images Stationary in Internet Explorer 6 for Windows; Using Internet Explorer for Windows Conditional Comments to Deliver Styles; Keeping CSS Rules from Internet Explorer 5 for Macintosh; Setting Up an Intelligent Hack Management System; Diagnosing CSS Bugs and Browser Issues; Testing a Site Design on More Than One Platform with Only One Computer; Installing More Than One Version of Internet Explorer for Windows on a Computer; Testing a Web Site with a Text Browser; Chapter 12: Designing with CSS; Introduction; Enlarging Text Excessively; Creating Unexpected Incongruity; Combining Unlike Elements to Create Contrast; Leading the Eye with Contrast; Checking for Enough Color Contrast; Emphasizing a Quotation; Appendix A: Resources; General HTML and CSS Instruction; Design Resources; Discussion Groups; References; Tools; Appendix B: CSS 2.1 Properties and Proprietary Extensions; Appendix C: CSS 2.1 Selectors, Pseudo-Classes, and Pseudo-Elements; Appendix D: Styling of Form Elements; Checkboxes; File Input; Radio Buttons; Text Fields; Multiple Options; Select Element; Submit Button; Textarea Element; Colophon;