Sclass"

From Documentation
m (correct highlight (via JWB))
 
Line 1: Line 1:
 
{{ZKStyleCustomizationGuidePageHeader}}
 
{{ZKStyleCustomizationGuidePageHeader}}
  
The <tt>sclass</tt> attribute is the way to add extra CSS Class to a component. By default, nothing is assigned to <tt>sclass</tt> (i.e. empty). Once you specify it with a non-empty value, ZK will add the specified CSS class to the root element as an additional CSS class.
+
The <code>sclass</code> attribute is the way to add extra CSS Class to a component. By default, nothing is assigned to <code>sclass</code> (i.e. empty). Once you specify it with a non-empty value, ZK will add the specified CSS class to the root element as an additional CSS class.
  
For example, assign <tt>sclass</tt> '''foo-pretty''' to a button component in zul page like this
+
For example, assign <code>sclass</code> '''foo-pretty''' to a button component in zul page like this
  
 
<source lang="xml">
 
<source lang="xml">
Line 17: Line 17:
 
</source>
 
</source>
  
The <tt>sclass</tt> won't change the default CSS classes applied to a component, so all the default CSS rules will still be applied and inherited. This attribute is useful to fine-tune a particular component.
+
The <code>sclass</code> won't change the default CSS classes applied to a component, so all the default CSS rules will still be applied and inherited. This attribute is useful to fine-tune a particular component.
  
 
=Version History=
 
=Version History=

Latest revision as of 13:24, 19 January 2022


The sclass attribute is the way to add extra CSS Class to a component. By default, nothing is assigned to sclass (i.e. empty). Once you specify it with a non-empty value, ZK will add the specified CSS class to the root element as an additional CSS class.

For example, assign sclass foo-pretty to a button component in zul page like this

<!-- index.zul -->
<button sclass="foo-pretty"/>

will generate the following output

<!-- HTML output -->
<button class="z-button foo-pretty" />

The sclass won't change the default CSS classes applied to a component, so all the default CSS rules will still be applied and inherited. This attribute is useful to fine-tune a particular component.

Version History

Last Update : 2022/01/19


Version Date Content
     



Last Update : 2022/01/19

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.