The SpryTabbedPanels.css file provides the default styling for the Tabbed Panels widget. You can, however, easily customize the widget by changing the appropriate CSS rule. The CSS rules in the SpryTabbedPanels.css file use the same class names as the related elements in the tabbed panel’s HTML code, so it’s easy for you to know which CSS rules correspond to the different sections of the Tabbed Panels widget. Additionally, the SpryTabbedPanels.css file contains class names for widget behaviors (for example, hovering and clicking behaviors).
The SpryTabbedPanels.css file should already be included in your website before you start customizing. For more information, see Prepare your files.
Style an Tabbed Panels widget (general instructions)Set properties for the entire Tabbed Panels widget container, or set properties for the components of the widget individually.
You can replace style-related class names in the SpryTabbedPanels.css file and HTML code with class names of your own. Doing so does not affect the functionality of the widget.
The SpryTabbedPanels.css file contains extensive comments, explaining the code and the purpose for certain rules. For further information, see the comments in the file.
Style Tabbed Panels widget textSet properties for the entire Tabbed Panels widget container, or set properties for the components of the widget individually.
Use the following table to locate the appropriate
CSS rule, and then add your own text-styling properties and values.
|
Text to change |
Relevant CSS rule |
Example of properties and values to add |
|---|---|---|
|
Text in the entire widget |
.TabbedPanels |
font: Arial; font-size:medium; |
|
Text in panel tabs only |
.TabbedPanelsTabGroup or .TabbedPanelsTab |
font: Arial; font-size:medium; |
|
Text in content panels only |
.TabbedPanelsContentGroup or .TabbedPanelsContent |
font: Arial; font-size:medium; |
Change Tabbed Panels widget background colors
Use the following table to locate the appropriate
CSS rule, and then add or change background-color properties and
values.
|
Color to change |
Relevant CSS rule |
Example of property and value to add or change |
|---|---|---|
|
Background color of panel tabs |
.TabbedPanelsTabGroup or .TabbedPanelsTab |
background-color: #DDD; (This is the default value.) |
|
Background color of content panels |
.Tabbed PanelsContentGroup or .TabbedPanelsContent |
background-color: #EEE; (This is the default value.) |
|
Background color of selected tab |
.TabbedPanelsTabSelected |
background-color: #EEE; (This is the default value.) |
|
Background color of panel tabs when the mouse pointer moves over them |
.TabbedPanelsTabHover |
background-color: #CCC; (This is the default value.) |
Constrain the width of tabbed panelsBy default, the Tabbed Panels widget expands to fill available space. To constrain the width of a Tabbed Panels widget, set a width property for the tabbed panel container.
Change tabbed panels heightBy default, the height of tabbed panels expands according to content. To set a specific height for panels, add a height property to the TabbedPanelsContent rule.
Change tabbed panels behaviorsThe Tabbed Panels widget includes predefined behaviors. These behaviors consist of changing CSS classes when a particular event occurs. For example, when a mouse pointer hovers over a panel tab, Spry applies the TabbedPanelsTabHover class to the widget. (This behavior is similar to a:hover for links.) The behaviors are blank by default; to change them, add properties and values to the rules.
<script type="text/javascript">
var TP1 = new Spry.Widget.TabbedPanels("TabbedPanels1", { tabHoverClass: "hover", panelVisibleClass: "open", tabSelectedClass: "selected", tabFocusedClass: "focused" });
</script>