HasStyle
API reference › HTML Attribute › Global › HasStyle
Used by 4 types
Provides an immutable API for the style attribute.
See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/style.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
style() | Sets the style attribute. | HasStyle |
Method details
Section titled “Method details”style()
Section titled “style() ”public function style(mixed[]|string|Stringable|UnitEnum|null $value): staticSets the style attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | mixed[]|Stringable|UnitEnum| | Style value as a CSS string, an associative array of CSS property-value pairs, or null to remove the attribute. |
Returns
static: New instance with the updated style attribute.