<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/webViewContentBackground(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewP08_WebKit_aB0E03webC17ContentBackgroundyQrAA10VisibilityOF"
  },
  "title" : "webViewContentBackground(_:)"
}
-->

# webViewContentBackground(_:)

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

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

## Parameters

`visibility`

The visibility to use for the background.

## Return Value

A view with the specified content background visibility.

## 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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)