Documentation
Styling and Appearance
jQWidgets uses a pair of css files - jqx.base.css and jqx.[theme name].css. The base stylesheet creates the styles related to the widget's layout like margin, padding, border-width, position. The second css file applies the widget's colors and backgrounds. The jqx.base.css should be included before the second CSS file.
Below is the list of CSS classes used by jqxRibbon.- jqx-widget - applied to the jqxRibbon widget.
- jqx-ribbon - applied to the jqxRibbon.
- jqx-widget-header - applied to the jqxRibbon header (the 'UL' element which includes the item tabs).
- jqx-ribbon-header - applied to the jqxRibbon header.
- jqx-ribbon-item - applied to the jqxRibbon items tabs ('LI' elements).
- jqx-ribbon-item-hover - applied to the hovered item tab.
- jqx-ribbon-item-selected - applied to the selected item tab.
- jqx-widget-content - applied to the jqxRibbon content and content sections.
- jqx-ribbon-content - applied to the jqxRibbon content (the 'DIV' element which includes the item content sections).
- jqx-ribbon-content-section - applied to the jqxRibbon item content sections ('DIV' elements).
- jqx-ribbon-scrollbutton - applied to the jqxRibbon scroll buttons.
- Add the above CSS classes related to jqxRibbon
- After each CSS class, add your theme name.
For example:
jqx-ribbon-orange - To apply your custom style to jqxRibbon, you need to set its 'theme' property(option)
to point to your theme name string.
<script type="text/javascript"> $(document).ready(function () { $("#jqxRibbon").jqxRibbon({ theme: "orange", width: 320, height: 200, position: "top", selectionMode: "click" }); });</script>
- The sample below demonstrates how to set the 'orange' theme to jqxRibbon and custom
colors to its ranges.
<!DOCTYPE html><html><head> <title>jQuery Ribbon Styling Sample</title> <link type="text/css" rel="Stylesheet" href="../../jqwidgets/styles/jqx.base.css" /> <link type="text/css" rel="Stylesheet" href="../../jqwidgets/styles/jqx.orange.css" /> <script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxribbon.js"></script> <script type="text/javascript"> $(document).ready(function () { $("#jqxRibbon").jqxRibbon({ theme: "orange", width: 320, height: 200, position: "top", selectionMode: "click" }); }); </script><script async src="https://www.googletagmanager.com/gtag/js?id=G-2FX5PV9DNT"></script><script>window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'G-2FX5PV9DNT');</script></head><body> <div id="jqxRibbon"> <ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> <div> <div> Content 1</div> <div> Content 2</div> <div> Content 3</div> </div> </div></body></html>