---
title: "webViewContentBackground(_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/webviewcontentbackground(_:)"
---

# webViewContentBackground(_:)

Specifies the visibility of the webpage’s natural background color within this view.

## Declaration

```swift
nonisolated func webViewContentBackground(_ visibility: Visibility) -> some View

```

## Parameters

- `visibility`: The visibility to use for the background.

## Return Value

Return Value A view with the specified content background visibility.

## Discussion

Discussion By default, WebViews are opaque, and use the page’s natural background color as their background color. Use this modifier if you would like to not use this behavior and instead provide a custom background using SwiftUI.

## See Also

### Displaying web content

- [WebView](webkit/webview-swift.struct.md)
- [WebPage](webkit/webpage.md)
- [onWebViewImmersiveEnvironmentRequest(shouldAllow:present:dismiss:)](swiftui/view/onwebviewimmersiveenvironmentrequest(shouldallow:present:dismiss:).md)
- [webViewBackForwardNavigationGestures(_:)](swiftui/view/webviewbackforwardnavigationgestures(_:).md)
- [webViewContextMenu(menu:)](swiftui/view/webviewcontextmenu(menu:).md)
- [webViewElementFullscreenBehavior(_:)](swiftui/view/webviewelementfullscreenbehavior(_:).md)
- [webViewLinkPreviews(_:)](swiftui/view/webviewlinkpreviews(_:).md)
- [webViewMagnificationGestures(_:)](swiftui/view/webviewmagnificationgestures(_:).md)
- [webViewOnScrollGeometryChange(for:of:action:)](swiftui/view/webviewonscrollgeometrychange(for:of:action:).md)
- [webViewScrollInputBehavior(_:for:)](swiftui/view/webviewscrollinputbehavior(_:for:).md)
- [webViewScrollPosition(_:)](swiftui/view/webviewscrollposition(_:).md)
- [webViewTextSelection(_:)](swiftui/view/webviewtextselection(_:).md)
