# AddToClassList

> Adds a class to the class list of the element in order to assign styles from USS. Note the class name is case-sensitive.

## Definition

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

## AddToClassList(string)

Adds a class to the class list of the element in order to assign styles from USS. Note the class name is case-sensitive.

```csharp
public void AddToClassList(string className)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the class to add to the list.

### Remarks

This method has no effect if class name is null or empty.

## AddToClassList(UniqueStyleString)

Adds a class to the class list of the element in order to assign styles from USS. Note the class name is case-sensitive.

```csharp
public void AddToClassList(UniqueStyleString className)
```

### Parameters

**** (\[UniqueStyleString]\(/engine/6000.6/script-reference/unityengine/uielements/uniquestylestring)): The name of the class to add to the list.

### Remarks

This method has no effect if class name is null or empty.

## AddToClassList(string, string)

Adds classes to the class list of the element in order to assign styles from USS. Note the class name is case-sensitive.

```csharp
public void AddToClassList(string className, string className2)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the class to add to the list.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of a second class to add to the list.

### Remarks

This method ignores class names that are null or empty. This method has no effect if all provided class names are null or empty.

## AddToClassList(UniqueStyleString, UniqueStyleString)

Adds classes to the class list of the element in order to assign styles from USS. Note the class name is case-sensitive.

```csharp
public void AddToClassList(UniqueStyleString className, UniqueStyleString className2)
```

### Parameters

**** (\[UniqueStyleString]\(/engine/6000.6/script-reference/unityengine/uielements/uniquestylestring)): The name of the class to add to the list.**** (\[UniqueStyleString]\(/engine/6000.6/script-reference/unityengine/uielements/uniquestylestring)): The name of a second class to add to the list.

### Remarks

This method ignores class names that are null or empty. This method has no effect if all provided class names are null or empty.

## AddToClassList(string\[])

Adds multiple classes to the class list of the element in order to assign styles from USS. Note the class names are case-sensitive.

```csharp
public void AddToClassList(params string[] classNames)
```

### Parameters

**** (\[string\[]]\(https\://learn.microsoft.com/dotnet/api/system.string)): The names of the classes to add to the list.

### Remarks

This method ignores class names that are null or empty. This method has no effect if all provided class names are null or empty.

## AddToClassList(UniqueStyleString\[])

Adds multiple classes to the class list of the element in order to assign styles from USS. Note the class names are case-sensitive.

```csharp
public void AddToClassList(params UniqueStyleString[] classNames)
```

### Parameters

**** (\[UniqueStyleString\[]]\(/engine/6000.6/script-reference/unityengine/uielements/uniquestylestring)): The names of the classes to add to the list.

### Remarks

This method ignores class names that are null or empty. This method has no effect if all provided class names are null or empty.

## AddToClassList(ReadOnlySpan\<UniqueStyleString>)

Adds multiple classes to the class list of the element in order to assign styles from USS. Note the class names are case-sensitive.

```csharp
public void AddToClassList(ReadOnlySpan<UniqueStyleString> classNames)
```

### Parameters

**** (\[ReadOnlySpan\<UniqueStyleString>]\(https\://learn.microsoft.com/dotnet/api/system.readonlyspan-1)): The names of the classes to add to the list.

### Remarks

This method ignores class names that are null or empty. This method has no effect if all provided class names are null or empty.
