O'Reilly logo

Web Design in a Nutshell, 2nd Edition by Jennifer Niederst Robbins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing SMIL

Explaining every element, attribute, and behavior within the SMIL 2.0 specification is beyond the scope of this chapter; however, what follows is a thorough introduction to the basic structures and components of SMIL.

Well-Formed Code

SMIL is an XML-based language, which means that all of its code needs to be “well formed” according to the rules of XML (see Chapter 30). When writing SMIL (or any XML application), follow these rules:

  • Tags are case-sensitive. For the most part, single-word elements and attributes are in all lowercase (e.g., <region>, <audio>, <switch>). Multiple-word elements and attributes use mixed case, also called camel case (e.g. systemLanguage, <priorityClass>, borderColor). It is important to stick to the capitalization structures in the specification.

  • All attribute values must be contained in double quotation marks.

  • All tags must be closed. For container tags, the closing tag must be present (e.g., < tagname >...</ tagname >). Empty tags (standalone elements that don’t have closing tags, such as <img> and <br> in HTML) are closed by the addition of a slash at the end of the tag (e.g., < emptytag />).

  • Nested elements must not overlap (e.g., <switch><par></par></switch>, not <switch><par></switch></par>).

Document Structure

Like HTML documents, SMIL documents are made up of a head element and body element. The head element contains information about the document, including layout instructions (using the <layout> , <meta> , and <metadata> elements). ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required