Skip to content
PHP Ecosystem
Explore

HasStyle

API reference › HTML Attribute › Global › HasStyle

traitUIAwesome\Html\Attribute\Global\HasStyle
Sourcesrc/Global/HasStyle.php
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.

MethodDescriptionDefined by
style()Sets the style attribute.HasStyle
public function style(mixed[]|string|Stringable|UnitEnum|null $value): static

Sets the style attribute.

Parameters

ParameterTypeDescription
$valuemixed[]|string|Stringable|UnitEnum|nullStyle 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.