---
title: "Asset.styleAttr ViewHelper <f:asset.styleAttr>"
manual: "Fluid ViewHelper Reference"
version: "14.3"
permalink: "https://docs.typo3.org/permalink/t3viewhelper:typo3-fluid-asset-styleattr@14.3"
source: "Global/Asset/StyleAttr.rst"
rendered: "2026-10-01T16:43:06+00:00"
---

# Asset.styleAttr ViewHelper `<f:asset.styleAttr>` {#typo3-fluid-asset-styleattr}

ViewHelper for inline style attributes that need CSP hash coverage via `style-src-attr`.

When `csp` is true (default), the style value is hashed and registered with the HashCollection so that the CSP header includes the corresponding `sha256-...` hash.

Usage:

Go to the source code of this ViewHelper: [Asset\\StyleAttrViewHelper.php (GitHub)](https://github.com/TYPO3/typo3/blob/main/typo3/sysext/fluid/Classes/ViewHelpers/Asset/StyleAttrViewHelper.php).

## Arguments of the `<f:asset.styleAttr>` ViewHelper {#typo3-fluid-asset-styleattr-arguments}

-   **csp**

    -   *Type:* bool
    -   *Default:* true

    Whether to collect a CSP hash for this style value

-   **value**

    -   *Type:* string
    -   *Required:* true

    The inline style value (e.g. "color: green; text-decoration: underline;")
