-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have a ZK page where I use a 'ckeditor' control to allow the user to enter some rich text. The page uses the ckeditor 'basic' toolbar attribute so the user has no facility to set the font.
On another ZK page I display this just created rich text usingvia a 'html' control. However, this displays the text in a different font to that used by other label components on the same page.
Is there a way of setting at either the 'ckeditor' or 'html' component level the font so that the text displayed by the 'html' control is using the same font at labels on the same page?
This is because ckeditor has its own default style, you can apply custom style as needed, for example, the sample below works well for me with ckez 4.0.1.0 on Chrome
<zk>
<style>
.cke-default {
font-family: sans-serif,Arial,Verdana,"Trebuchet MS";
font-size: 13px;
line-height: 1.6em;
color: #333;
margin: 20px;
}
.cke-default p {
display: block;
-webkit-margin-before: 1em;
-webkit-margin-after: 1em;
-webkit-margin-start: 0px;
-webkit-margin-end: 0px;
}
</style>
<ckeditor onChange="System.out.println(self.getValue()); h.setContent(self.getValue());" />
<html id="h" class="cke-default" />
</zk>
Asked: 2013-04-18 06:07:30 +0800
Seen: 32 times
Last updated: Apr 26 '13