HTML5 & CSS3 for the Real World
Curious to see what we’ve got in store for you?
Good, because there’s plenty of meaty technique to get your teeth into along with lots of tips and tricks. Have a look through the table of contents to see what’s covered.
Table of Contents
Foreword
Preface
- Who Should Read This Book
- What’s in This Book
- Where to Find Help
- The SitePoint Forums
- The Book’s Website
- The SitePoint Newsletters
- The SitePoint Podcast
- Your Feedback
- Acknowledgments
- Alexis Goldstein
- Louis Lazaris
- Estelle Weyl
- Conventions Used in This Book
- Code Samples
- Tips, Notes, and Warnings
1. Introducing HTML5 and CSS3
- What is HTML5?
- How did we get here?
- Would the real HTML5 spec please stand up?
- Why should I care about HTML5?
- What is CSS3?
- Why should I care about CSS3?
- What do we mean by the “real world”?
- The Varied Browser Market
- The Growing Mobile Market
- On to the Real Stuff
2. Markup, HTML5 Style
- Introducing The HTML5 Herald
- A Basic HTML5 Template
- The Doctype
- The
htmlElement - The
headElement - Leveling the Playing Field
- The Rest is History
- HTML5 FAQ
- Why do these changes still work in older browsers?
- Shouldn’t all tags be closed?
- What about other XHTML-based syntax customs?
- Defining the Page’s Structure
- The
headerElement - The
sectionElement - The
articleElement - The
navElement - The
asideElement - The
footerElement
- The
- Structuring The HTML5 Herald
- Wrapping Things Up
3. More HTML5 Semantics
- A New Perspective on Types of Content
- The Document Outline
- Breaking News
- The
hgroupElement
- The
- More New Elements
- The
figureandfigcaptionElements - The
markElement - The
progressandmeterElements - The
timeElement
- The
- Changes to Existing Features
- The Word “Deprecated” is Deprecated
- Block Elements Inside Links
- Bold Text
- Italicized Text
- Big and Small Text
- A
citefor Sore Eyes - Description (not Definition) Lists
- Other New Elements and Features
- The
detailsElement - Customized Ordered Lists
- Scoped Styles
- The
asyncAttribute for Scripts
- The
- Validating HTML5 Documents
- Summary
4. HTML5 Forms
- Dependable Tools in Our Toolbox
- HTML5 Form Attributes
- The
requiredAttribute - The
placeholderAttribute - The
patternAttribute - The
disabledAttribute - The
readonlyAttribute - The
multipleAttribute - The
formAttribute - The
autocompleteAttribute - The
datalistElement and thelistAttribute - The
autofocusAttribute
- The
- HTML5 New Form Input Types
- Search
- Email Addresses
- URLs
- Telephone Numbers
- Numbers
- Ranges
- Colors
- Dates and Times
- Other New Form Controls in HTML5
- The
outputElement - The
keygenElement
- The
- Changes to Existing Form Controls and
Attributes
- The
formElement - The
optgroupElement - The
textareaElement
- The
- In Conclusion
5. HTML5 Audio and Video
- A Bit of History
- The Current State of Play
- Video Container Formats
- Video Codecs
- Audio Codecs
- What combinations work in current browsers?
- The Markup
- Enabling Native Controls
- The
autoplayAttribute - The
loopAttribute - The
preloadAttribute - The
posterAttribute - The
audioAttribute - Adding Support for Multiple Video Formats
sourceOrder- What about Internet Explorer 6–8?
- MIME Types
- Encoding Video Files for Use on the Web
- Creating Custom Controls
- Some Markup and Styling to Get Us Started
- Introducing the Media Elements API
- Playing and Pausing the Video
- Muting and Unmuting the Video’s Audio Track
- Responding When the Video Ends Playback
- Updating the Time as the Video Plays
- Further Features of the Media Elements API
- What about audio?
- Accessible Media
- It’s Showtime
6. Introducing CSS3
- Getting Older Browsers on Board
- CSS3 Selectors
- Relational Selectors
- Attribute Selectors
- Pseudo-classes
- Structural Pseudo-classes
- Pseudo-elements and Generated Content
- CSS3 Colors
- RGBA
- HSL and HSLA
- Opacity
- Putting It into Practice
- Rounded Corners:
border-radius - Drop Shadows
- Inset and Multiple Shadows
- Text Shadow
- More Shadows
- Up Next
7. CSS3 Gradients and Multiple Backgrounds
- Linear Gradients
- The W3C Syntax
- The Old WebKit Syntax
- Putting It All Together
- Linear Gradients with SVG
- Linear Gradients with IE Filters
- Tools of the Trade
- Radial Gradients
- The W3C Syntax
- The Old WebKit Syntax
- Putting it All Together
- Repeating Gradients
- Multiple Background Images
- Background Size
- In the Background
- Linear Gradients
8. CSS3 Transforms and Transitions
- Transforms
- Translation
- Scaling
- Rotation
- Skew
- Changing the Origin of the Transform
- Support for Internet Explorer 8 and Earlier
- Transitions
transition-property- transition-duration
- transition-timing-function
- transition-delay
- The transition Shorthand Property
- Multiple Transitions
- Animations
- Keyframes
- Animation Properties
- Moving On
- Transforms
9. Embedded Fonts and Multicolumn Layouts
- Web Fonts with
@font-face- Implementing
@font-face - Declaring Font Sources
- Font Property Descriptors
- Unicode Range
- Applying the Font
- Legal Considerations
- Creating Various Font File Types: Font Squirrel
- Other Considerations
- Implementing
- CSS3 Multicolumn Layouts
- The column-count Property
- The column-gap Property
- The column-width Property
- The columns Shorthand Property
- Columns and the height Property
- Other Column Features
- Other Considerations
- Progressive Enhancement
- Media Queries
- What are Media Queries?
- Syntax
- Flexibility of Media Queries
- Browser Support
- Further Reading
- Living in Style
- Web Fonts with
10. Geolocation, Offline Web Apps, and Web Storage
- Geolocation
- Privacy Concerns
- Geolocation Methods
- Checking for Support with Modernizr
- Retrieving the Current Position
- Geolocation’s
PositionObject - Grabbing the Latitude and Longitude
- Loading a Map
- A Final Word on Older Mobile Devices
- Offline Web Applications
- How It Works: the HTML5 Application Cache
- Setting Up Your Site to Work Offline
- Getting Permission to Store the Site Offline
- Going Offline to Test
- Making The HTML5 Herald Available Offline
- Limits to Offline Web Application Storage
- The Fallback Section
- Refreshing the Cache
- Are we online?
- Further Reading
- Web Storage
- Two Kinds of Storage
- What Web Storage Data Looks Like
- Getting and Setting Our Data
- Converting Stored Data
- The Shortcut Way
- Removing Items and Clearing Data
- Storage Limits
- Security Considerations
- Adding Web Storage to The HTML5 Herald
- Viewing Our Web Storage Values with the Web Inspector
- Additional HTML5 APIs
- Web Workers
- Web Sockets
- Web SQL and IndexedDB
- Back to the Drawing Board
- Geolocation
11. Canvas, SVG, and Drag and Drop
- Canvas
- A Bit of Canvas History
- Creating a
canvasElement - Drawing on the Canvas
- Getting the Context
- Filling Our Brush with Color
- Drawing a Rectangle to the Canvas
- The Canvas Coordinate System
- Variations on fillStyle
- Drawing Other Shapes by Creating Paths
- Saving Canvas Drawings
- Drawing an Image to the Canvas
- Manipulating Images
- Converting an Image from Color to Black and White
- Security Errors with
getImageData - Manipulating Video with Canvas
- Displaying Text on the Canvas
- Accessibility Concerns
- Further Reading
- SVG
- Drawing in SVG
- Using Inkscape to Create SVG Images
- SVG Filters
- Using the Raphaël Library
- Canvas versus SVG
- Drag and Drop
- Feeding the WAI-ARIA Cat
- Making Elements Draggable
- The
DataTransferObject - Accepting Dropped Elements
- Further Reading
- That’s All, Folks!
- Canvas
A. Modernizr
- Using Modernizr with CSS
- Using Modernizr with JavaScript
- Support for Styling HTML5 Elements in IE8 and Earlier
- Further Reading
B. WAI-ARIA
- How WAI-ARIA Complements Semantics
- The Current State of WAI-ARIA
- Further Reading
C. Microdata
- Aren’t HTML5’s semantics enough?
- The Microdata Syntax
- Understanding Name-Value Pairs
- Microdata Namespaces
- Further Reading
Index
More Information
What’s the Course?
The HTML5 + CSS3 Online Course
Get the benefit of online learning with the Learnable Online Course.
It contains:
- 10 Lessons
- 28 Video Tutorials
- 30 day Money Back Guarantee
Plus an interactive Q&A where you can ask questions (and get answers) from fellow students and Louis the instructor.
Customer Reviews
Live, unmoderated reviews from our customers, typos and all.
Explains the important points to consider when creating a website. I would like to have seen a little more information explaining why, perhaps with some examples; especially for people starting out.
Lee Morris, USA 
A complete and clear explanation of the new features of HTML 5 and CSS 3 explained on a funny and engaging way.
Fabricio Matías Quagliariello, USA 
HTML5 & CSS3 for the Real World is a really excellent book to get started with all the new and exciting for a beginner like me.
The book is thorough and very educational, very well written.
Knud Erik Asmussen, USA 
