---
title: "styleDeclaration(withText:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/webview-swift.class/styledeclaration(withtext:)"
---

# styleDeclaration(withText:)

Returns the CSS style declaration for the specified text.

## Declaration

```swift
func styleDeclaration(withText text: String!) -> DOMCSSStyleDeclaration!
```

## Parameters

- `text`: The text whose style declaration is returned.

## Return Value

Return Value The style declaration for text.

## See Also

### Getting and Setting CSS Properties

- [computedStyle(for:pseudoElement:)](webkit/webview-swift.class/computedstyle(for:pseudoelement:).md)
- [mediaStyle](webkit/webview-swift.class/mediastyle.md)
- [typingStyle](webkit/webview-swift.class/typingstyle.md)
- [applyStyle(_:)](webkit/webview-swift.class/applystyle(_:).md)
