Content Formatting Macros for Confluence Server and DC

Span Tag

The Span Tag 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 its 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 Sheet as this would make it easy to apply custom styles to content. Alternatively specify specific styles for each use of the macro.

Usage

  1. Go to the form you wish to edit.

  2. Click Edit.

  3. Click Insert More Content, and select Other Macros.

  4. Select the Span Tag macro from the provided list.

    span 01
  5. Complete the desired fields.

    Parameter

    Description

    Type

    Default

    Required

    ID

    Specify a unique id for the element

    string

    none

    error

    Class

    Specify a class for the element

    string

    none

    error

    Style

    An optional inline style sheet to apply to an individual span tag

    string

    none

    error

    Title

    Specify text to display in a tooltip

    string

    none

    error

    Text Direction

    Set the text direction.

    single select

    none

    error

    Language Code

    Specify the input language, e.g. en, de.

    string

    none

    error

    Output type

    Specifies that the macro will be displayed inline with the surrounding content

    single select

    Inline

    check
  6. The macro will then appear on the page.

    span 02

Examples

Define a Span

By default, a span will not affect the way things look on-screen:

span 03

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 its parameters are used as shown in the following examples.

Custom Class

To define a custom class, use the Class parameter. The class will be applied only to the content contained within the Span macro.

Inline Styles

If you are using borders, images, or icons, inline styles can be used to add padding between the Span macro content and other content.

Hints and Tips

If using the same inline style several times, create a stylesheet for the class using either the Style Sheet or the Builder - CSS Custom Styles feature of the Builder theme.

Frequently Asked Questions

Q: Where can I learn more about CSS and Span tags?

A: Try http://www.w3schools.com, as they have full tutorials on CSS and HTML.