Web APIs

CSS Typed Object Model API

Checking compatibility...

Work with CSS values and properties using strongly-typed JavaScript objects. Perform calculations, manipulate styles, and handle complex properties with better performance and type safety.

Basic Style Map

This example shows how to read the actual CSS values applied to an element, getting proper objects instead of text strings, which makes working with the values much easier.

=
=
=
=
=
=

Output

Click Run to see output...

CSS Values and Units

This example demonstrates how to create and work with CSS measurements, doing math operations while automatically handling units like pixels, percentages, and degrees.

=
=
=
=
=
=

Output

Click Run to see output...

Attribute Style Map

This example shows how to apply complex style changes directly to elements, like rotations and transforms, using a more powerful alternative to the style attribute.

=
=
=
=
=
=

Output

Click Run to see output...