The {span} macro wraps content in a span tag with optional class and styles...
The span tag is a non-visual (by default) element that can be used to apply additional properties to content contained within it. Unlike the div tag, a span does not stretch to fill the available width of it's containing element making it ideal for use with inline content such as a portion of text in a paragraph or a cell within a table.
This macro is primarily designed for use with the style macro as this would make it easy to apply custom styles to your content. Alternatively you can specify specific styles for each use of the macro.
Add the macro to your page as follows:
{span:class=x y z|style=css}
your content
{span}
Parameters
Parameter
Required
Default
Notes
class
The class to associate with the span. Multiple classes can be specified by separating them with spaces.
style
An optional inline style sheet to apply to an individual span tag.
This plug-in is available without cost for both commercial and non-commercial purposes. However, if you have found it to be useful, particularly within a commercial environment, please consider making a donation to the author. This will encourage continued development of this and other plug-ins, as well as speeding up the response for your latest maintenance request.
If you wish to donate, it can be done easily with a credit card or bank transfer using PayPal. No account sign-up is required for credit or debit card payments.
The {search-box macro} is released under the BSD License.
This macro has been tested by Adaptavist with Confluence 1.4.1, 1.4.3, 1.4.4, 2.0, 2.1 and 2.1.2.
It is usually pre-installed with Builder accounts. To install it on your own Confluence installation, please see Content Formatting Macros
Adaptavist maintain a JIRA Project for tracking bug reports and feature requests for this macro. The currently reported items are shown below:
jiraissues: Could not download[ http://jira.adaptavist.com/secure/IssueNavigator.jspa?view=rss&pid=10080&component=10140&statusIds=1&statusIds=3&statusIds=4&statusIds=5&sorter/field=updated&sorter/order=DESC&tempMax=25&reset=true&decorator=none] : caused by : Circular redirect to 'http://jira.adaptavist.com:80/secure/IssueNavigator.jspa'
By default a span will not affect the way things look on-screen:
This is {span}a span{span} example
This will add the following HTML to your page:
<p>This is <span>a span</span> example
Resulting in: This is a span example
The macro only becomes useful when you use it's parameters as shown in the following examples...
Custom Class
To define a custom class, use the "class" parameter:
This is {span:class=tipMacro}a span{span} example
This will add the following HTML to your page:
<p>This is <span class="tipMacro">a span</span> example
Resulting in: This is a span example
As you can see, we've hijacked the "tipMacro" class used by the tip macro to put a green border and background on the text contained within the span.
Inline Styles
In our last example, we applied a green background and border to some content, but there wasn't any padding between the border and the text - to rectify that we can use an inline style:
This is {span:class=tipMacro|style=padding:3px}a span{span} example
This will add the following HTML to your page:
<p>This is <span class="tipMacro" style="padding:3px">a span</span> example
Resulting in: This is a span example
Hints and Tips
If you are using the same inline style several times, create a stylesheet for the class using either the style macro or the CSS Custom Styles feature of the Builder theme.