Book Image

HTML5 Multimedia Development Cookbook

Book Image

HTML5 Multimedia Development Cookbook

Overview of this book

HTML5 is the most significant new advancement the web has seen in many years. HTML5 adds many new features including the video, audio, and canvas elements, as well as the integration of SVG. This cookbook is packed full of recipes that will help you harness HTML5’s next generation multimedia features. HTML5 is the future.Whether you’re a seasoned pro or a total newbie, this book gives you the recipes that will serve as your practical guide to creating semantically rich websites and apps using HTML5. Get ready to perform a quantum leap harnessing HTML5 to create powerful, real world applications. Many of the new key features of HTML5 are covered, with self-contained practical recipes for each topic. Forget hello world. These are practical recipes you can utilize straight away to create immersive, interactive multimedia applications. Create a stylish promo page in HTML5. Use SVG to replace text dynamically. Use CSS3 to control background size and appearance. Use the Canvas to process images dynamically. Apply custom playback controls to your video.
Table of Contents (16 chapters)
HTML5 Multimedia Development Cookbook
Credits
Foreword
About the Authors
About the Reviewers
www.PacktPub.com
Preface

Using background-size to control background appearance


Using CSS3, we now have a way to specify the size of our background images. We can specify this size in pixels, width and height, or in percentages. When you specify a size as a percentage, the size is relative to the width or height of the area that we have designated using background-origin.

Getting ready

Let's take a look at a real-world example at http://miessociety.org, a gorgeous website by Simple Honest Work, an agency created by designer Scott Thomas and dedicated to preserving the legacy of architect Ludwig Mies van der Rohe.

How to do it...

If we view the source of the stylesheet, we'll see the authors created one rule for the body and then specified that any background image used would cover the entire body.

The authors also specified a background image for each page by attaching an ID to each body element.

How it works...

Here we see how the creators used some simple styling, including the new background-size property, to stretch...