# StyleLength

> Style value that can be either a Length or a StyleKeyword.

## Definition

* **Type:** Struct
* **Namespace:** [UnityEngine.UIElements](/engine/6000.0/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule
* **Implements:** [IStyleValue\<Length>](/engine/6000.0/script-reference/unityengine/uielements/istylevalue1.md), [IEquatable\<StyleLength>](https://learn.microsoft.com/dotnet/api/system.iequatable-1)

```csharp
public struct StyleLength : IStyleValue<Length>, IEquatable<StyleLength>
```

## Constructors

| Constructor                                                                                                                                                | Description                                                                                                                                                                                   |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [StyleLength(System.Single)](/engine/6000.0/script-reference/unityengine/uielements/stylelength/ctor.md#stylelength\(float\))                              | Creates from either a [Length](/engine/6000.0/script-reference/unityengine/uielements/length.md) or a [StyleKeyword](/engine/6000.0/script-reference/unityengine/uielements/stylekeyword.md). |
| [StyleLength(UnityEngine.UIElements.Length)](/engine/6000.0/script-reference/unityengine/uielements/stylelength/ctor.md#stylelength\(length\))             | Creates from either a [Length](/engine/6000.0/script-reference/unityengine/uielements/length.md) or a [StyleKeyword](/engine/6000.0/script-reference/unityengine/uielements/stylekeyword.md). |
| [StyleLength(UnityEngine.UIElements.StyleKeyword)](/engine/6000.0/script-reference/unityengine/uielements/stylelength/ctor.md#stylelength\(stylekeyword\)) | Creates from either a [Length](/engine/6000.0/script-reference/unityengine/uielements/length.md) or a [StyleKeyword](/engine/6000.0/script-reference/unityengine/uielements/stylekeyword.md). |

## Properties

| Property                                                                                 | Description                                                                           |
| ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| [keyword](/engine/6000.0/script-reference/unityengine/uielements/stylelength/keyword.md) | The style keyword.                                                                    |
| [value](/engine/6000.0/script-reference/unityengine/uielements/stylelength/value.md)     | The [Length](/engine/6000.0/script-reference/unityengine/uielements/length.md) value. |
