Sclass"

From Documentation
m
Line 1: Line 1:
 
{{ZKStyleCustomizationGuidePageHeader}}
 
{{ZKStyleCustomizationGuidePageHeader}}
  
Styling Class (aka. sclass) is a way to add extra CSS Class to a component. By default, nothing is assigned to sclass (i.e. empty). Once it is assigned with a non-empty value (<javadoc method="setSclass(java.lang.String)">org.zkoss.zk.ui.HtmlBasedComponent</javadoc>), it will be added to the root element as an additional CSS class.
+
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.
  
For example, assign sclass '''foo-pretty''' to a button component in zul page like this
+
For example, assign <tt>sclass</tt> '''foo-pretty''' to a button component in zul page like this
  
 
<source lang="xml">
 
<source lang="xml">
Line 17: Line 17:
 
</source>
 
</source>
  
Sclass won't change the naming of the default CSS classes, so all the default CSS rules will be applied and inherited. It is useful to fine-tune a particular component.
+
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.
  
 
=Version History=
 
=Version History=

Revision as of 03:29, 24 January 2019


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 : 2019/01/24


Version Date Content
     



Last Update : 2019/01/24

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