---
title: "webView(_:shouldApplyStyle:toElementsIn:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/webeditingdelegate/webview(_:shouldapplystyle:toelementsin:)"
---

# webView(_:shouldApplyStyle:toElementsIn:)

Returns whether the user should be allowed to apply a style to a range of content.

## Declaration

```swift
optional func webView(_ webView: WebView!, shouldApplyStyle style: DOMCSSStyleDeclaration!, toElementsIn range: DOMRange!) -> Bool
```

## Parameters

- `webView`: The web view that the user is editing.
- `style`: The style to apply.
- `range`: The range of the content.

## Return Value

Return Value true if the user should be allowed to apply the style to the content range; otherwise, false.

## See Also

### Related Documentation

- [WebKit Objective-C Programming Guide](apple-archive/documentation/Cocoa/Conceptual/DisplayWebContent.md)
