Book description
HTML5 brings the biggest changes that HTML has seen in years. Web designers and developers now have a whole host of new techniques up their sleeves, from displaying video and audio natively in HTML, to creating realtime graphics directly onto a web page without the need for a plugin. But all of these new technologies bring more tags to learn and more avenues for things to go wrong. HTML5 Solutions provides a collection of solutions to all of the most common HTML5 problems. Every solution contains sample code that is production ready and can be applied to any project.
What you'll learn
Real-world solutions for everyday HTML development, saving hours of frustration. Problems covered include:
Sending Multi-bit rate videos to different devices
Creating custom video components
Programming a custom video controller
Designing a canvas with custom gradients
Capturing and drawing images
Storing data offline using the Web SQL Databases
Dragging data from the desktop into the browser
Creating HTML5 Web Sockets
Who this book is for
Web developers and designers wanting practical advice on making HTML5 sites work.
Table of contents
- Copyright
- Credits
- About the Authors
- About the Technical Reviewer
- About the Cover Image Artist
- Acknowledgments
- Introduction
-
1. HTML5 Page Structures
- 1.1. Solution 1-1: Creating a DOCTYPE in HTML5
- 1.2. Solution 1-2: Creating a character encoding declaration in HTML5
- 1.3. Solution 1-3: Dividing a document into sections
- 1.4. Solution 1-4: Making parts of the document distributable
- 1.5. Solution 1-5: Creating an aside
- 1.6. Solution 1-6: Creating a header
- 1.7. Solution 1-7: Grouping <h1> to <h6> elements
- 1.8. Solution 1-8: Creating a footer
- 1.9. Solution 1-9: Creating navigation in an HTML5 document
- 1.10. Solution 1-10: Inserting figures
- 1.11. Solution 1-11: Browser compatibility
- 1.12. Summary
- 2. HTML5 Markup
-
3. HTML5 Structural and Semantic Elements
- 3.1. Understanding microdata
- 3.2. Solution 3-1: Using the itemprop and itemscope attributes
- 3.3. Solution 3-2: Creating a custom vocabulary
- 3.4. Solution 3-3: Understanding link types and relations
- 3.5. Solution 3-4: The header and hgroup elements
- 3.6. Solution 3-5: Connecting images with their captions
- 3.7. Solution 3-6: Adding tangent content
- 3.8. Summary
-
4. HTML5 Forms
- 4.1. Understanding the new input types
- 4.2. Solution 4-1: Using the e-mail input type
- 4.3. Solution 4-2: Using the URL input type
- 4.4. Solution 4-3: Using a spinner control for numbers
- 4.5. Solution 4-4: Adding a slider to your form with the range input type
- 4.6. Solution 4-5: Sending multiple files
- 4.7. Solution 4-6: Creating a suggest-like autocomplete with the data list component
- 4.8. Solution 4-7: Validating form controls
- 4.9. Solution 4-8: Creating custom input types using regular expressions
- 4.10. Solution 4-9: Setting placeholder text in an input field
- 4.11. Solution 4-10: Creating date and time controls
- 4.12. Summary
-
5. HTML5 Media Elements: Audio and Video
- 5.1. Solution 5-1: Embedding a video in a web page
- 5.2. Solution 5-2: Detecting video support across browsers
- 5.3. Solution 5-3: Creating a custom video controller
- 5.4. Solution 5-4: Preloading a video
- 5.5. Solution 5-5: Creating a custom seek bar for a video
- 5.6. Solution 5-6: Using multiple source video elements
- 5.7. Solution 5-7: Opening a video in full screen
- 5.8. Solution 5-8: Applying a mask to a video
- 5.9. Solution 5-9: Using the audio element
- 5.10. Summary
-
6. HTML5 Drawing APIs
- 6.1. Solution 6-1: How to draw with HTML5 using the canvas element's drawing API
- 6.2. Solution 6-2: Using paths and coordinates
- 6.3. Solution 6-3: Drawing shapes: rectangles and circles
- 6.4. Solution 6-4: Filling shapes with solid colors
- 6.5. Solution 6-5: Using gradients to fill shapes
- 6.6. Solution 6-6: Drawing texts in a canvas
- 6.7. Solution 6-7: Working with relative font sizes to draw text on a canvas
- 6.8. Solution 6-8: Saving a shape as a PNG file
- 6.9. Summary
-
7. HTML5 Canvas
- 7.1. Solution 7-1: Understanding the canvas APIs
- 7.2. Solution 7-2: Detecting the canvas and canvas text support
- 7.3. Solution 7-3: Understanding the standard screen-based coordinate system and canvas transformations
- 7.4. Solution 7-4: Pixel manipulations
- 7.5. Solution 7-5: Applying shadows and blurring
- 7.6. Solution 7-6: Animating canvas
- 7.7. Summary
-
8. HTML5 Communication APIs
- 8.1. Understanding the postMessage API
- 8.2. Securing the postMessage communication
- 8.3. Solution 8-1: Checking for postMessage API browser support
- 8.4. Cross-documents messaging and CORS
- 8.5. Solution 8-2: Sending messages between windows and iframes
- 8.6. Solution 8-3: Using Server-Event technologies to write real-time web applications
- 8.7. Solution 8-4: Running code in different browsing contexts using message channels
- 8.8. Solution 8-5: Uploading files using the XMLHttpRequest Level 2
- 8.9. Solution 8-6: Checking for XMLHttpRequest level 2 cross-origin browser support
- 8.10. Summary
- 9. HTML5 WebSocket
-
10. HTML5 Geolocation API
- 10.1. Understanding the Geolocation API
- 10.2. Solution 10-1: Using the navigator object
- 10.3. Solution 10-2: Getting the current position
- 10.4. Solution 10-3: Using the position object
- 10.5. Solution 10-4: Handling position errors
- 10.6. Solution 10-5: Tracking the user's position
- 10.7. Solution 10-6: Using the geo.js open source library
- 10.8. Summary
-
11. HTML5 Local Storage
- 11.1. Solution 11-1: Understanding Occasionally-Connected Applications
- 11.2. Solution 11-2: Checking for HTML5 storage support
- 11.3. Solution 11-3: Declaring a manifest for your page
- 11.4. Solution 11-4: Using the ApplicationCache object
- 11.5. Solution 11-5: The ApplicationCache events
- 11.6. Solution 11-6: Deleting the local cache
- 11.7. Summary
-
12. HTML5 Accessibility
- 12.1. The four principles of accessibility
- 12.2. The purpose of the WCAG
- 12.3. Solution 12-1: Creating skip links with the nav element
- 12.4. Solution 12-2: Creating accessible tabular data
- 12.5. Solution 12-3: Creating accessible forms
- 12.6. Solution 12-4: Captioning and annotations using video elements
- 12.7. Solution 12-5: Using the ARIA project
- 12.8. Summary
Product information
- Title: HTML5 Solutions: Essential Techniques for HTML5 Developers
- Author(s):
- Release date: June 2011
- Publisher(s): Apress
- ISBN: 9781430233862
You might also like
book
HTML5 Unleashed
HTML5 Unleashed is the authoritative guide that covers the key web components driving the future of …
book
The Definitive Guide to HTML5
The Definitive Guide to HTML5 provides the breadth of information you'll need to start creating the …
video
Offline Mobile Web Applications in HTML5
Although HTML5 has a ton of bells and whistles, it's very much an integral part of …
book
HTML5: 20 Lessons to Successful Web Development
Master HTML and HTML5 in 20 lessons--online video tutorials included! Based on the author's successful online …