diff --git a/src/Html.php b/src/Html.php
index <HASH>..<HASH> 100644
--- a/src/Html.php
+++ b/src/Html.php
@@ -116,6 +116,13 @@ class Html extends Markup
         if (!isset($this->attributeList['class']) || is_null($this->attributeList['class'])) {
             $this->attributeList['class'] = [];
         }
+        if (!is_array($this->attributeList['class'])) {
+            if (!empty($this->attributeList['class'])) {
+                $this->attributeList['class'] = [$this->attributeList['class']];
+            } else {
+                $this->attributeList['class'] = [];
+            }
+        }
         foreach ($value as $class_name) {
             $class_name = trim($class_name);
             if (!empty($class_name)) {
Added fix for the class attribute that could be a string