Hi everyone!
I cannot fix the problem with the styles inside the editor itself: it seems to apply different line-heights inside the paragraphs and between them:
What I need is just setting the constant line-height.
Adding it to body in contents.css doesn't make any change...
I'd be grateful for any possible solution. Thanks!
Sun, 01/10/2010 - 17:10
#1
Re: Problem with the line-height inside the editor
In your declaration, add the contentsCss config entry:
Then you need to define test.css, with the path being relative to the root of your site:
Using this, I was able to get the paragraphs to cease adding extra spacing between them.
Re: Problem with the line-height inside the editor
works perfectly, thanks! However, I do not understand, why didn't it work with adding the same content into contents.css.
Is this a bug?
One more question is how to change the font-size inside the editor now. This code inside the test.css doesn't help:
Many thanks for your attention.
Re: Problem with the line-height inside the editor
It didn't work to add it to the body tag because, by default, CKEditor does not operate in fullPage mode, meaning that there is no body tag in the editor.
As for font size, are the provided drop downs insufficient?
I am assuming you want it to start large by default and you can achieve this by adding the following to css file referenced with contentsCss:
Re: Problem with the line-height inside the editor
I've switched into the fullPage mode and it work fine now. Thanks!
However, I'm just curious: is it fullPage=false by default to make the editor lighter?
Re: Problem with the line-height inside the editor
In v3.1 of CKEditor they introduced fullPage mode which includes all of these tags. The benefit is your styling now works correctly, the downside is that CKEditor, or web based editors in general, have not the capability to produce visually stunning webpages on their own. In other words, sites turn out pretty "frontpage-ish".
Re: Problem with the line-height inside the editor
fullPage is meant to be used when you are editing a full page, you have some stylesheets at the head, or scripts or whatever and so you want to edit the full content instead of having to rebuild the page later, then this setting is for you, but "CKEditor is designed with the assumption that only page segments are used in the editor" is just wrong as that setting proves.
If you set fullPage=true then the content that it's returned will include the <html><head>...</head><body>.. tags, and this might not be what you want. So be sure that you understand what it means before using it and then asking why does it returns those tags.
In the edited content there's always a body, by default it won't be returned as part of the edited HTML, but of course it exists and if you provide a stylesheet to change it's appearance it will reflect those changes.
But if you are using a rule like "p {...}" you aren't styling the body, you are styling the paragraphs inside the body, and you might not see the changes if you modify the wrong file or you are using a cached version
Setting something like
in the stylesheet is a very bad idea because then everything will be that size, usually this will cause troubles when you want to use different sizes along your content.
So relax a little, read the documentation and take a rest before asking/replying questions, this is not a race.
Re: Problem with the line-height inside the editor
In addition, the fact that fullPage was added in v3.1 and not in v3.0 suggests to me that the original intent is to edit a chunk of page instead of the entire structure. Is conjecture so wrong?
Re: Problem with the line-height inside the editor
vs
Re: Problem with the line-height inside the editor
Re: Problem with the line-height inside the editor
You started correctly pointing Kolosovska that it's not a problem with line heights and that the required change is to set the correct margin on Ps. If that didn't work in his initial test then it could be due to a cache or that it's trying to change the wrong file, but following from that point to change the fullPage setting it's a wrong move. Indeed, setting the editor to fullPage should ignore any contentCss file as in that situation you are supposed to provide all the content for the page, including any stylesheets in the header.
So don't give up and keep on helping people, just be careful because most of the times the answer is simply that they need to clear the cache and look at the error console.
Re: Problem with the line-height inside the editor
alfonsoml,
now I understand that it's better not to use fullPage=true and that my problems come from the non-cleared cache.
However, I've read the docs (http://docs.cksource.com/CKEditor_3.x/Developers_Guide) before asking and they don't seem to cover even half of my questions, unfortunately.
Anyways, many thanks, as one problem has been already solved!