helpers\BaseHtml addCssStyle()

addCssStyle() public static method

Adds the specified CSS style to the HTML options.

If the options already contain a style element, the new style will be merged with the existing one. If a CSS property exists in both the new and the old styles, the old one may be overwritten if $overwrite is true.

For example,

Html::addCssStyle($options, 'width: 100px; height: 200px');

See also:

public static void addCssStyle ( &$options, $style, $overwrite = true )
$options array

The HTML options to be modified.

$style string|array

The new style string (e.g. 'width: 100px; height: 200px') or array (e.g. ['width' => '100px', 'height' => '200px']).

$overwrite boolean

Whether to overwrite existing CSS properties if the new style contain them too.

doc_Yii
2016-10-30 17:04:58
Comments
Leave a Comment

Please login to continue.