Learn HTML DOM
Manipulating DOM Elements
4.14
Lesson

Changing Multiple Page Styles

With the style property we can only change a single style property at a time. For changing multiple style properties together, we need to use the style.cssText property.

Let’s try changing the width and font-size of this square div:

As you can see, in this property we can simply write CSS the way we normally write it, with hyphens in long property names.