# style

> Sets the style values on a VisualElement.

## Definition

* **Type:** Property
* **Namespace:** [UnityEngine.UIElements](/engine/6000.5/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule

```csharp
public IStyle style { get; }
```

### Remarks

The returned style data, computed from USS files or inline styles written to this object in C#, doesn't represent the fully resolved styles, such as the final height and width of a VisualElement. To access these fully resolved styles, use [\_resolvedStyle](/engine/6000.5/script-reference/unityengine/uielements/visualelement/resolvedstyle.md).

For information about how to use this property and all the supported USS properties, refer to the [Apply styles in C# scripts](/engine/6000.5/manual/uitoolkits/uielements/uie-uss/uie-apply-styles-with-csharp.md) and [USS properties reference](/engine/6000.5/manual/uitoolkits/uielements/uie-uss/properties/reference.md) manual pages.

Additional Resources: [VisualElement.resolvedStyle](/engine/6000.5/script-reference/unityengine/uielements/visualelement/resolvedstyle.md), [VisualElement.customStyle](/engine/6000.5/script-reference/unityengine/uielements/visualelement/customstyle.md), [StyleSheet](/engine/6000.5/script-reference/unityengine/uielements/stylesheet.md)

### Examples

```csharp
// Set the background color of the element to red.
element.style.backgroundColor = Color.red;
```
