This macro is bundled with all the XWiki products by default.
Macro developed by the XWiki Development Team.
This macro cannot currently be downloaded separately.

Style Macro

Styles a block of content (internally it generates an HTML DIV or SPAN). It supports many properties of these 2 elements.

The style macro be a superset of the existing info, warning, error and floatingbox macros. We need use some class match with those macros

Usage

{style:type=<div|span>|id=<id>|class=<class>|align=<align>|font-size=<size>|color=<color>|font-family=<font>|width=<width>|height=<height>}text{style}

Parameters definition

Supported properties (note that all of them are properties that exist for DIVs and SPANs):

  • id : id of span of div tag
  • class (some classes: warningmessage,errormessage, infomessage, plainmessage, floatinginfobox,… matching with warning, error, info … macros)
  • name
  • align : allow align a paragraph to left, center, right, full
  • font-size
  • font-family
  • color
  • background-color
  • width
  • height
  • float
  • border
  • icon and document
({style...|icon=msgwarning.jpg|document=Main.Mypage} if the document parameter is specified then it find msgwaring.jpg in attachments of Main.Mypage or current page or in icons directory , If it isn't found then it display image empty for icon

Example

{style:type=div|color=red|width=50%|height=50%}
This is the content in div block 
{style}

Will generate the following when rendered:

<div style="color:red;width:50%;height=50%">
  This is the content in div block
</div>

or

{style:type=div|border=1px solid red|background-color=green|width=300px|height=300px|color=red|
icon=msgwarning.png|document=Main.Mypage}
This is the content of style macro
{style}

Result

This is the content in div block

or

stylemacro.JPG

Version 5.1 last modified by VincentMassol on 19/06/2008 at 22:13

Comments 0

No comments for this document

Attachments 1

Image
stylemacro.JPG 1.2
PostedBy: PhunghaiNam on 09/12/2007 (4kb )

Creator: PhunghaiNam on 2007/03/30 13:51
This wiki is licensed under a Creative Commons license
1.4.1.10194