From Documentation

Jump to: navigation, search



  • Demonstration: Html
  • Java API: Html
  • JavaScript API: Html
  • Style Guide: N/A


The simplest way is to use an XUL component called html to embed whatever HTML tags you want to send directly to the browser. To avoid ZK from interpreting the HTML tags, you usually enclose them with <![CDATA[ and ]]>. In other words, they are not the child component. Rather, they are stored in the content property. Notice you can use EL expressions in it.


ZKComRef Html.png

 <window id="win" title="Html Demo" border="normal">
         <h4>Hi, ${win.title}</h4>
         <p>It is the content of the html component.</p>

where <h4>...</p> will become the content of the html element (see also the getContent method of the org.zkoss.zul.Html class).

The html component generates the HTML SPAN tag to enclose the content. In other words, it generates the following HTML tags when rendered to the browser.

 <span id=”...”>
     <h4>Hi, Html Demo</h4>
     <p>It is the content of the html component.</p>

Size issue

On Chrome, if <html>'s sibling use vflex to set hight flexibly, developer must override .z-html CSS like this:

.z-html {


.z-html {
	display: inline-block;

Without this setting, offsetHeight of <html> will be zero, and sibling's height will be wrong.

Supported Events

Event Type
None None

Supported Children


Use Cases

Version Description Example Location
3.6 Work with HTML tags: The Html component The Html component
3.6 herf attribute in Html component
3.6 Use Html component to escape HTML characters

Version History

Last Update : 2012/9/4

Version Date Content

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