style"
(Created page with "{{ZUMLReferencePageHeader}} '''Syntax:''' <?style [type="text/css"] [src="''uri''"] [charset="''encoding''"] [content="''css snippet''"] [if="..."] [unless="..."]?> [since...") |
|||
Line 5: | Line 5: | ||
[content="''css snippet''"] [if="..."] [unless="..."]?> | [content="''css snippet''"] [if="..."] [unless="..."]?> | ||
− | + | {{versionSince | 5.0.8}} | |
It specifies an element that shall be generated inside the HEAD element. It is generated ''after'' ZK default JavaScript and CSS files. Thus, it could override what is defined in ZK default CSS code. Currently only HTML-based clients (so-called browsers) support it. Furthermore, HTML STYLE or LINK tags are actually generated for each of this declaration. | It specifies an element that shall be generated inside the HEAD element. It is generated ''after'' ZK default JavaScript and CSS files. Thus, it could override what is defined in ZK default CSS code. Currently only HTML-based clients (so-called browsers) support it. Furthermore, HTML STYLE or LINK tags are actually generated for each of this declaration. |
Revision as of 08:54, 19 November 2020
Syntax:
<?style [type="text/css"] [src="uri"] [charset="encoding"] [content="css snippet"] [if="..."] [unless="..."]?>
Since 5.0.8
It specifies an element that shall be generated inside the HEAD element. It is generated after ZK default JavaScript and CSS files. Thus, it could override what is defined in ZK default CSS code. Currently only HTML-based clients (so-called browsers) support it. Furthermore, HTML STYLE or LINK tags are actually generated for each of this declaration.
Developers can specify whatever attributes you like; it is up to the browser to interpret. ZK only evaluates the if
and unless
attributes, and encodes the URI of the href and src attribute (by use of Execution.encodeURL(String)). ZK generates all other attributes directly to the client.
Notice that these header directives are effective only for the main ZUL page. In other words, they are ignored if a page is included by another pages or servlets. Also, they are ignored if the page is a zhtml file.
<syntax lang="xml" > <?style src="/css/foo.css"?> <?style content="
div.blue {background: blue}
"?>
My content
</syntax>
As shown above, the attribute value could span multiple lines.
Alternatives
Alternatively, you could use the style component to embed CSS code. Using the style component if you'd like to add or remove the style dynamically (since it is a component), or the page will be included by others.
Version History
Version | Date | Content |
---|---|---|
5.0.8 | July, 2011 | The style directive was introduced. |