CSS and attributes

Most of wiki blocks, in the form of [element], accept passing CSS style attributes and element attributes. There are several differences, though. Styles are separated by comma instead of semicolon. They are introduced directly between parenthesis, not in a style attribute. Element attributes, for example class, are prefixed with &.

Let's see by example using the [block] element:

CSS styles

Wiki

[block(background-color:#eee,color:#333,padding:5px 10px)]

Result

<div style="background-color:#eee;color:#333;padding:5px 10px;">

Class attribute

Wiki

[block(&class:ui segment)]

Result

<div class="ui segment">

Mixing both

Wiki

[block(&class:ui segment,background-color:#eee,color:#333,padding:5px 10px)]

Result

<div class="ui segment" style="background-color:#eee;color:#333;padding:5px 10px;">

For full CSS specification details see CSS at W3C. Starters might prefer LEARN & USE.

Printer version
English01/09/18 14:58Lluís Turró Cutiller
English01/16/18 12:27Lluís Turró Cutiller