Pro CSS for High Traffic Websites Copyright © 2011 by Antony Kennedy and Inayaili de León All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. ISBN-13 (pbk): 978-1-4302-3288-9 ISBN-13 (electronic): 978-1-4302-3289-6 Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights. President and Publisher: Paul Manning Lead Editor: Ben Renow-Clarke Technical Reviewer: David Storey Editorial Board: Steve Anglin, Mark Beckner, Ewan Buckingham, Gary Cornell, Jonathan Gennick, Jonathan Hassell, Michelle Lowman, Matthew Moodie, Jeff Olson, Jeffrey Pepper, Frank Pohlmann, Douglas Pundick, Ben Renow-Clarke, Dominic Shakeshaft, Matt Wade, Tom Welsh Coordinating Editor: Mary Tobin Copy Editor: Nancy Sixsmith Compositor: Bytheway Publishing Services Indexer: John Collin Artist: April Milne Cover Designer: Anna Ishchenko Distributed to the book trade worldwide by Springer Science+Business Media, LLC., 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800- SPRINGER, fax (201) 348-4505, e-mail , or visit [email protected] . www.springeronline.com For information on translations, please e-mail , or visit [email protected] . www.apress.com Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Special Bulk Sales–eBook Licensing web page at . www.apress.com/info/bulksales The information in this book is distributed on an “as is” basis, without warranty. Although every precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work. The source code for this book is available to readers at , and from www.apress.com . www.procssforhightrafficwebsites.com Contents at a Glance Foreword About the Authors About the Technical Reviewer Acknowledgments Preface Background Information Chapter 1: The Value of Process Chapter 2: CSS Style Guide Chapter 3: Fundamentals Chapter 4: Frameworks and Integration Chapter 5: Brand Implementation Chapter 6: CSS and Accessibility Chapter 7: Devices Chapter 8: Performance Chapter 9: Dynamic CSS Chapter 10: Testing and Debugging Chapter 11: Creating Your CSS Appendix 1: CSS Standards Guide Appendix 3: Browser Support Guidelines Appendix 4: Development Process Contents Foreword About the Authors About the Technical Reviewer Acknowledgments Preface Background Information Chapter 1: The Value of Process The Team Getting Too Big for Your Boots High Staff Churn Rate Consistency Is More Important than Quality Tools Wikis Bug Reporting Task Management Bug Tracking and Task Management Source Control Diff Tools Resolving Conflicts Backup Online Backup Desktop Backup Prototyping Development Methodologies Waterfall Development Agile Development Summary Chapter 2: CSS Style Guide CSS Style Guides CSS Formatting Single-versus Multiline Indenting Tabs versus Spaces Colons and Semicolons Commenting and CSS Metadata Existing Standards: CSSDOC File Info Table of Contents Sectioning Color Palettes Folder Paths Measurements Document Hacks and Bug Fixes Using a Template Class and ID Naming Semantics Accepted Characters Conventions Case Namespacing Reusable Classes CSS Namespaces Module Summary Chapter 3: Fundamentals The Cascade: Origin, Importance, and Inheritance Origin and Importance Inheritance Inheritance and the Universal Selector Specificity Calculating Specificity The !important Declaration Namespacing and Specificity Using Your Tools Encoding Localization Browser-Specific CSS Hacks and Filters CSS Expressions Vendor-Specific Extensions Media Queries Conditional Comments When and How to Use Hacks “Safe” Hacks The Real World Server-Side User Agent Detection Some Examples of Browser Rendering Differences Quirks Mode The IE Box Model hasLayout Experimental CSS Summary Chapter 4: Frameworks and Integration Frameworks Blueprint CSS 960 Grid System YUI 3 Grids Alternative Uses Reset Style Sheets Why Create Your Own Framework? Object Oriented CSS Object Oriented Programming OOCSS
Description: