Boxes under Style Maco

I used the Style Macro in CKEditor to draw boxes but I can’t seem to change the width which defaults to the width of the page. I’ve tried adding width=“50px;” but it does nothing to the boxes. How do you change the width of a box drawn using the Style macro?

Source:

(% class=“box warningmessage” id=“HSoftware” %)
(((
== [[Software>>doc:Software.WebHome]] ==
)))

Also what is the difference between these:

{{box cssClass=“infomessage” width=“50%”}}
Test Message
{{/box}}

and

(% class=“box warningmessage” id=“HSoftware” %)
(((
== [[Software>>doc:Software.WebHome]] ==
)))

The first uses the Box macro while the second uses plain wiki syntax, but the result is similar. The implementation of the Box macro could change of course and thus the result could be different in the future.

Regarding your first question, this works for me:

(% class=“box warningmessage” id=“HSoftware” style="width:50%" %)
(((
== [[Software>>doc:Software.WebHome]] ==
)))

Using the Box macro is better for upgrades. The advantage of the plain wiki syntax on older versions of XWiki was that the content was editable inside CKEditor, but now this is true for the Box macro also (on newer versions of XWiki).

See also Remove box styles from WYSIWYG?