Learn something new every day
More Info... by email
In the HyperText Markup Language (HTML), an HTML animation is any item that appears to be moving or changing on a web page, usually without any user input. This can be anything from a bouncing ball to a bank of letters that flash on and off like a neon sign. The actual HTML standard and cascading style sheets (CSS) do not really have any intrinsic animation tags or functions, although they do provide enough access to the rendering portions of a web browser that animation can be performed by changing the rendering properties of an element. More often, animated image file formats, external programming languages or links to streaming media sources are used, especially in the case of complex or long animations.
One easy way to create an HTML animation is to use a special file format for graphics known as a graphic image file (GIF). This file format allows for multiple images to be stored in a file, along with some other information that is interpreted by a web browser and displayed as an animation sequence. A GIF file has the advantage of not requiring any special plug-ins or software and is relatively small in size. Some restrictions, however, include a set number of colors in the images and being somewhat inefficient for larger HTML animation sequences.
Another popular way to create an HTML animation is through the use of a separately developed library of functions — either through CSS or another programming language — that are called from within the HTML code of the website. This has the advantage of providing a good amount of flexibility and animation options. Complications can occur if a given web browser has scripting turned off, does not have support for the library — as might be the case with a handheld device — or has low processing power, because animation libraries could be very taxing on a system.
For HTML animation that is complex or very lengthy, a common method is to construct the completed animation in a separate program and then record that animation as a type of media file. Within an HTML document, the media file is embedded as an element in which the animation is automatically played for the user. This can help relieve some of the burden on the computer’s processor and can be very memory efficient. Conversely, a streaming media HTML animation can take up a large amount of bandwidth and might not appear correctly if the speed of an Internet connection is too slow.