We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to set CSSClass property for the nodes/connectors/labels/ports

You can customize the appearance of a node by setting Cascading Style Sheet (CSS) class name as the value for cssClass property. Similarly, you also can apply CSS for connectors, labels, decorators and ports using theirs cssClass property.

The following code illustrates how to set CSS class for Diagram elements.







The limitations of using the CSSClass are as follows.

  1. When we export the diagram, the style applied via CssClass will not be exported.
  2. Serialization (save and load) can be performed in the diagram. The class properties which we define will be serialized as a string and the style properties should be maintained it in the application level. 
  3. If we define the style property such as stroke,fill,stroke-width in both CssClass and the node’s properties, then the style defined in the CssClass will be rendered.
  4. If we hover on the label, the CssClass which we have applied for the node will not be reflected because we have rendered the node’s and connector’s in the different layers.
  5. CssClass will not applied for the elements which have inline styles.
Article ID: Published Date: Last Revised Date: Platform: Control:
5813 11/28/2015 11/28/2015 JavaScript ejDiagram
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Please sign in to access our KB

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon