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

Adding a box shadow to images


Previously, a visual effect like a shadow under or around an image was only possible by using a second image for the shadow or making the shadow itself part of the image. The problem was that if you ever wanted to adjust the shadow, you had to recut it. Let's look at a modern, smart way to do it using CSS3.

Getting ready

Check out the attractive and subtle shadow around the visual elements at http://thebox.maxvoltar.com. Author Tim Van Damme has applied the new CSS3 box-shadow attribute.

How to do it...

Let's examine the styles to see how Tim achieved that beautifully simple effect:

<style>
section {
background: none repeat scroll 0 0 #EAEEF1;
border: 1px solid #FFFFFF;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
margin: 0 auto;
padding: 49px;
position: relative;
width: 300px;
z-index: 50;
}
</style>

In addition to other styles, we can clearly see the box-shadow attribute specifying a color and spread distance for the shadow.

How it works...

The syntax...