Ask AI
Hi! Ask me anything

CSS styles

Elephant allows passing CSS attributes to Wiki tags and Wmacros. The way this is done differs.

CSS is an extensive specification. You may like to see CSS at W3C. Starters might prefer LEARN & USE.

CSS in Wmacros

Most Wmacros accept the parameter style with standard CCS as value.

In the example we use absolute positioning. When doing so, the segment is no longer governed by container positioning and can overlap other content.
Top/right
@w{segment(style="width:150px;height:50px;position:absolute;top:1px;right:1px")}
Top/right
@w{/segment}

CSS in Wiki tags

Wiki tags have their own CSS way of writing attributes. Main differences are:

  • No need to specify style, attributes treated as CSS.
  • Attributes are separated with comas, instead of semicolons.
  • Attributes like class, href and others, are treated as HTML attributes.
  • No need to double quotes.
Same example as with Wmacros, but using Wiki syntax.
Top/right
[div(width:150px,height:50px,position:absolute,top:1px,right:1px,border:1px solid silver,padding:0.5em,class:rounded)]
Top/right
[/div]
English07/20/26 05:42Lluís Turró Cutiller