Formatting toggles with CSS

Navigation:  More Advanced Procedures > Toggles: Expanding Text and Images >

Formatting toggles with CSS

Previous pageReturn to chapter overviewNext page

Show/Hide Hidden Text

When your help is exported to HTML-based formats the <a> link tags for the text toggles and the <img> tag for the image toggles are exported with CSS classes, which makes it possible to change the appearance and behavior of your toggle links by adding CSS style definitions for these classes to the HTML template for your topic pages.

Following the instructions in this topic requires some experience with writing HTML manually and using CSS styles. If you feel stumped by this we recommend that you get an experienced friend or colleague to help you.

See the Using HTML Templates and About HTML Templates chapters more information on using and editing HTML templates.

Click to expand/collapseThe CSS class names for the toggle link types

Help & Manual exports CSS classes to the main tags of all three toggle types. The classes are applied to the <a> link tags for the expanding section and expanding inline text toggles and to the <img> image tag for the expanding image toggles.

You must use the classes directly as properties of the tags that you want to apply them to, otherwise they won't work properly. This means that you must use the syntax img.image-toggle {} for defining styles for your image toggles and a.inline-toggle {} and a.dropdown-toggle {} for defining styles for your text toggle links.

Toggle Type

Class Name

Link Code Example

Expanding section toggles:

dropdown-toggle

<a class="dropdown-toggle" title="Tooltip text"
href="...JavaScript toggle code...">
Section toggle header/link text</a>

Expanding inline text toggles:

inline-toggle

<a class="inline-toggle" title="Tooltip text"
href="...JavaScript toggle code...">
Inline toggle link text</a>

Expanding image toggles:

image-toggle

<img id="TOGGLE0186A2" class="image-toggle"
src="imagename.jpg" border="0"
alt="imagename.jpg" title="Tooltip text">

Click to expand/collapseExample of style CSS class definitions for toggles

The following example shows you how to format your toggle links and images with a CSS style definition using the class names listed above. The style definitions are shown inserted in the standard HTML template for topic pages. The toggle styles are shown in blue, the other style definitions are for the other hyperlink types in the help.

Sample CSS Definitions for Toggles

<%DOCTYPE%>

<html>

<head>

  <title><%TOPIC_TITLE%></title>

  <meta name="generator" content="Help &amp; Manual" />

  <meta name="keywords" content="<%TOPIC_KEYWORDS%>" />

  <meta http-equiv="Content-Type" content="text/html; charset=<%DOCCHARSET%>" />

  <meta http-equiv="Content-Style-Type" content="text/css" />

  <link type="text/css" href="<%STYLESHEET%>" rel="stylesheet" />

 

<style type="text/css">

<!-- These are the normal hyperlink styles -->

 a { color: #0000FF; text-decoration: none }

 a:visited {color: #0000FF }

 a:hover {color: #E4641C; text-decoration: underline }

 a.weblink {color: #0000FF; text-decoration: underline }

 a.weblink:visited {color: #0000FF}

 a.weblink:hover {color: #E4641C }

 a.popuplink {color: #FF0000; text-decoration: none}

 a.popuplink:visited {color: #FF0000}

 a.popuplink:hover {color: #FF0000; text-decoration: underline}

 a.filelink {color: #04BC14; text-decoration: none}

 a.filelink:visited {color: #04BC14}

 a.filelink:hover {color: #04BC14; text-decoration: underline}

<!-- These are the toggle styles -->

a.dropdown-toggle {color: Navy; text-decoration: none;  font-weight: bold;  font-family: "Times New  Roman", Times, serif; }

 a.drop-down-toggle:visited {color: Navy; }

 a.drop-down-toggle:hover {text-decoration: underline}

 a.inline-toggle {color: Green; text-decoration: none;  font-weight: bold;  font-family: "Times New Roman", Times, serif;  }

 a.inline-toggle:visited {color: Green; }

 a.inline-toggle:hover {text-decoration: underline}

 img.image-toggle { border: border-width: 2px; border-color: red; border-style: solid;}

</style>  

 

 

</head>

<body style="margin: 0px 0px 0px 0px; background: <%TOPIC_TEXT_BGCOLOR%>;">

....

See also:

Using HTML Templates

About HTML Templates