This edition first published 2013
2013 Ian Lunn
Registered office
John Wiley & Sons Ltd, The Atrium, Southern Gate, Chichester, West Sussex, PO19 8SQ, United Kingdom
For details of our global editorial offices, for customer services and for information about how to apply for permission to reuse the copyright material in this book please see our website at www.wiley.com.
The right of the author to be identified as the author of this work has been asserted in accordance with the Copyright, Designs and Patents Act 1988.
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, except as permitted by the UK Copyright, Designs and Patents Act 1988, without the prior permission of the publisher.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books.
Designations used by companies to distinguish their products are often claimed as trademarks. All brand names and product names used in this book are trade names, service marks, trademarks or registered trademarks of their respective owners. The publisher is not associated with any product or vendor mentioned in this book. This publication is designed to provide accurate and authoritative information in regard to the subject matter covered. It is sold on the understanding that the publisher is not engaged in rendering professional services. If professional advice or other expert assistance is required, the services of a competent professional should be sought.
Trademarks: Wiley and the Wiley logo are trademarks or registered trademarks of John Wiley and Sons, Inc. and/ or its affiliates in the United States and/or other countries, and may not be used without written permission. All other trademarks are the property of their respective owners. John Wiley & Sons, Ltd. is not associated with any product or vendor mentioned in the book. the treehouse logo, mike the frog, and related treehouse website content is 2012 treehouse island, inc. Logos and content cannot be reproduced without first obtaining permission from copyright holder.
978-1-118-35654-8
A catalogue record for this book is available from the British Library.
ISBN 978-1-118-35654-8 (paperback); ISBN 978-1-118-42516-9 (ebook); 978-1-118-42514-5 (ebook); 978-1-118-42515-2 (ebook)
Printed in the U.S. at Command Web Missouri
About the Author
Ian Lunn (Devon, UK) is a Freelance Front End Developer, passionate about building the future of the web using technologies such as CSS3 and HTML5. With a Higher National Diploma in Internet Technology, Ian combines his education with expertise in CSS, HTML, JavaScript, and WordPress to build creative and effective websites and applications. Ians enthusiasm for utilizing cutting edge technologies is matched by his dedication for advocating them; sharing his knowledge with the community, in the form of blog tutorials and open source projects.
Follow @IanLunn on Twitter (www.twitter.com/IanLunn) where he shares links and ideas about web design and development.
Publishers Acknowledgements
Some of the people who helped bring this book to market include the following:
Editorial and Production
VP Consumer and Technology Publishing Director:
Michelle Leete
Associate DirectorBook Content Management:
Martin Tribe
Associate Publisher:
Chris Webb
Assistant Editor:
Ellie Scott
Development Editor:
Brian Herrmann
Copy Editor:
Chuck Hutchinson
Technical Editor:
Nick Elliott
Editorial Manager:
Jodi Jensen
Senior Project Editor:
Sara Shlaer
Editorial Assistant:
Leslie Saxman
Marketing
Associate Marketing Director:
Louise Breinholt
Marketing Executive:
Kate Parrett
Composition Services
Compositor:
Andrea Hornberger
Jennifer Mayberry
Proofreaders:
Linda Seifert
Indexer:
Ty Koontz
Introduction
Youre reading CSS3 Foundations at an exciting time. Right now, the way in which the web is styled is undergoing changes, and with the constant advancement of technology, that doesnt look to end any time soon. The web is already a beautiful place, but with more features allowing you to style a page than ever, the possibilities of what can be created are endless.
Who Should Read This Book?
CSS3 Foundations is for those completely new to styling web pages, but also makes as a great reference for those familiar with CSS tooparticularly when you want to remind yourself of the newest CSS features that you may not have committed to memory.
Ideally, you have a basic understanding of HTML (Hypertext Markup Language) but its not essential. The HTML that makes up the web page built upon throughout CSS3 Foundations is provided for you and described in Chapter 2. So, whether youve chosen to start learning CSS before HTML, or vice versa, youll be gently eased into both technologies.
If youre a hobbyist, somebody looking to make a career change into the wonderful world of the web industry, an owner of a website that is need of restyling, or a web designer/developer looking to upgrade your skills to the most recent techniques and methods in use today, CSS3 Foundations is for you.
What You Will Learn
CSS3 Foundations aims to get you not just hitting the ground running, but hopping, stepping, and jumping too!
Youll go from the very basics of styling a web page; changing the background color, the size of text, and so on, all the way through to more advanced topics such as animations and media queries, which allow you to change a pages layout for different sizes of device.
Although the easiest topics come first and slowly progress to reach the more advanced chapters, the way in which CSS3 Foundations is laid out represents the workflow I, and many other people in the web industry use to create a website. So, as well as learning CSS, youll also learn a best practice approach that can be applied to real-world projects, to make pages not just great to look at, but easy to update and robust enough to be viewed on a wide range of devices too (such as desktop computer and mobile phone).
Youll also learn methods and techniques not described in the CSS specification (the official technical document that explains CSS), which web designers and developers have relied on for years to make the most of CSS.
How to Use This Book
In Chapter 2, Ill introduce you to a fictitious company that has asked you to create a web pagetheres no pay but the experience is golden! Youll be able to download the necessary project files to get started. This download contains updated project files for each chapter (which are sometimes broken into milestones for the bigger chapters). Ill let you know when a milestone is reached and you can either use the project files to compare to your own work, or switch to that milestones project files in case you didnt follow the steps that came before it.
Depending on your current experience with CSS, you may decide to jump ahead to the chapters that interest you most -- thats fine, the beginning of each chapter will let you know which project files to start with.
Once youve finished reading CSS3 Foundations, itll make a great desktop companion for when you need to remind yourself on how to use a feature or solve a particular problem. Each property description includes useful information for quick reference, such as the propertys initial value, browser compatibility, and so on. If youre unfamiliar with those terms, Ill explain those too!