> This page is for Designer API.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.webflow.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.webflow.com/_mcp/server.

# Set Styles

> Set styles on an element.

## `element.setStyles(styles)`

Set styles on an element.

## Syntax

```typescript
element.setStyles(styles: Array<Style>): Promise<null>>
```

## Parameters

* **`Styles`**: *Array* of [Style Objects](/designer/reference/styles-overview) - The array of styles to set.

## Returns

**Promise\<`null`>**

A Promise that resolves to `null`.

## Example

```javascript
// Get Selected Element
const selectedElement = await Webflow.getSelectedElement()

if (selectedElement?.styles) {

  // Create a new style
  const newStyle = await Webflow.createStyle("MyCustomStyle");

  // Set properties for the style
  newStyle.setProperties({
    'background-color': "blue",
    'font-size': "32px",
    'font-weight': "bold",
  });

  // Set style on selected element
  selectedElement.setStyles([newStyle])

}
```