Using style sheets in items

Style sheets can be used to format the look and feel of IBM® Lotus Web Content Management pages in the same way as normal Web Pages.

Creating and referencing style sheet elements

Style sheet elements can only be stored in style sheet components.

To link a style sheet component to a specific authoring template, you must select a style sheet component as the default style sheet in an authoring template.

To link a style sheet component to a specific site, site area or content item, you must add a component reference element to a site, site area or content item and select a style sheet component.

Referencing a style sheet element in a presentation template

Style sheet elements are referenced in the "header" section of a presentation template using either a style element tag or component tag.

To use the style sheet specified in the authoring template of the current content item, you must use a <styleElement> tag.

<HTML>
<HEAD>
<styleElement source="template"/></HEAD>
<BODY></BODY>
</HTML>

To use the style sheet selected in a component reference element stored in either the current site, site area or content item, you must use a <styleElement> tag.

<HTML>
<HEAD>
<styleElement source="path" name="component 
reference name"/></HEAD>
<BODY></BODY>
</HTML>

To use a specific style sheet, you must use a <component> tag.

<HTML>
<HEAD>
<component name="style sheet 
component name"/></HEAD>
<BODY></BODY>
</HTML>
When rendered in Web content, references to style sheet components are rendered as external style sheet links:
<HTML>
<HEAD>
<link href="stylesheet" media="media-type" rel="styleheet-type" type="text">
</HEAD>
<BODY></BODY>
</HTML>

Using styles in HTML tags

Styles are used in HTML stored in presentation templates and element designs in the same way as normal HTML. The style must exist in the style sheet that has been referenced in the presentation template used to render the HTML.

For example, to add a class called "wcm" to a heading tag:

<H1 class="wcm">Heading</H1>

Using styles in Web content tags

Style sheets can be used to format the style of content retrieved using Web Content Management tags. The style must exist in the style sheet referenced in the presentation template used to render the Web Content Management tag.

For example, to format the links in a menu using a style sheet class called "wcm", the following placeholder tag would be used:

<a href="<placeholder tag="href" />" class="wcm"><placeholder tag="name" /></a>