I want to be able to style the first letter of selected divs by adding something like
div.FirstParagraph:first-letter
{
font-size: 1.5em;
font-style: italic;
}
to my css.
But to make this work, I need to be able to apply this div definition to the selected text in FCKeditor so that the selected text -- usually the first paragraph -- is wrapped in <div class="FirstParagraph"></div>. I think the best way would be to add an option to the Format dropdown, similar to Normal and Normal (div): something like Normal (FirstParagraph) or even just FirstParagraph. But I haven't been able to figure out if this is possible (the documentation that I have seen suggests that you cannot add to this dropdown).
I have not been able to implement this using CustomStyles because there is no way (that I can see) to specify that this is a div with a class name.
So what I have done is to add the following to fckstyle.xml:
<Style name="FirstParagraph" element="div">
<Attribute name="class" value="FirstParagraph" />
</Style>
and this works. But is this the best way of doing this? It seems I am messing with stuff that is going to be overridden with the next release, and there may be an "official way" way of doing this
Thanks
Reg
div.FirstParagraph:first-letter
{
font-size: 1.5em;
font-style: italic;
}
to my css.
But to make this work, I need to be able to apply this div definition to the selected text in FCKeditor so that the selected text -- usually the first paragraph -- is wrapped in <div class="FirstParagraph"></div>. I think the best way would be to add an option to the Format dropdown, similar to Normal and Normal (div): something like Normal (FirstParagraph) or even just FirstParagraph. But I haven't been able to figure out if this is possible (the documentation that I have seen suggests that you cannot add to this dropdown).
I have not been able to implement this using CustomStyles because there is no way (that I can see) to specify that this is a div with a class name.
So what I have done is to add the following to fckstyle.xml:
<Style name="FirstParagraph" element="div">
<Attribute name="class" value="FirstParagraph" />
</Style>
and this works. But is this the best way of doing this? It seems I am messing with stuff that is going to be overridden with the next release, and there may be an "official way" way of doing this
Thanks
Reg

Re: Adding a New Format
FCKConfig.CustomStyles = { 'Red Title' : { Element : 'h3', Styles : { 'color' : 'Red' } }, 'FirstParagraph' : { Element : 'div', Attributes : { 'class' : 'FirstParagraph' } } };StylesXmlPath
Frederico Knabben
CKEditor Project Lead and CKSource Owner
--
Follow us on: Twitter | Facebook | Google+ | LinkedIn
Re: Adding a New Format
Reg