/**
* Set Div element background color style.
*
* @param string $color Div element background color style.
*
* @return self Returns instance of the Div element class.
*
* @access public
*/
public function bg(string $color): self
Examples
Set named background color style using fluent interface
use function Thermage\div;
use function Thermage\render;
// ...
render(
div('Stay RAD!')->bg('red')
);
Set hex background color style using fluent interface
use function Thermage\div;
use function Thermage\render;
// ...
render(
div('Stay RAD!')->bg('#dc3545')
);
Set rgb background color style using fluent interface
use function Thermage\div;
use function Thermage\render;
// ...
render(
div('Stay RAD!')->bg('rgb(220, 53, 69)')
);
Set background color style using magic method fluent interface
use function Thermage\div;
use function Thermage\render;
// ...
render(
div('Stay RAD!')->bgRed()
);
Set background color style using magic classes pipeline
use function Thermage\div;
use function Thermage\render;
// ...
render(
div('Stay RAD!', 'bg-red')
);
Set background color style using shortcodes
use function Thermage\div;
use function Thermage\render;
// ...
render(
div('[bg=red]Stay RAD![/bg]')
);
Set hex background color style using shortcodes
use function Thermage\div;
use function Thermage\render;
// ...
render(
div('[bg=#dc3545]Stay RAD![/bg]')
);
Set rgb background color style using shortcodes
use function Thermage\div;
use function Thermage\render;
// ...
render(
div('[bg="rgb(220, 53, 69)"]Stay RAD![/bg]')
);
Terminal
$ php thermage.php
Stay RAD!
Getting Started
Methods
- bg Set Div element background color style.
- blink Set Div element blink style.
- bold Set Div element bold style.
- border Set Div element border style.
- borderColor Set Div element border color style.
- clearfix Force Div element to self-clear its children block elements linebreaks.
- color Set Div element text color style.
- d Set Div element display style.
- dim Set Div element dim style.
- getShortcodes Get Div element shortcodes instance.
- getTheme Get Div element theme.
- getValue Get Div element value.
- h Set Div element height.
- invisible Set Div element invisible style.
- italic Set Div element italic style.
- m Set Div margin style.
- mb Set Div margin bottom style.
- ml Set Div margin left style.
- mr Set Div margin right style.
- mt Set Div margin top style.
- mx Set Div margin x style.
- my Set Div margin y style.
- p Set Div padding style.
- pb Set Div padding bottom style.
- pl Set Div padding left style.
- pr Set Div padding right style.
- pt Set Div padding top style.
- px Set Div padding x style.
- py Set Div padding y style.
- render Render Div element.
- reverse Set Div element reverse property.
- setShortcodes Set Div element shortcodes instance.
- setTheme Set Div element theme instance.
- strikethrough Set Div element strikethrough style.
- textAlign Set Div element text align.
- textAlignVertical Set Div element text align vertical.
- textOverflow Set Div element text overflow.
- underline Set Div element underline style.
- value Set Div element value.
- w Set Div element width.