k> I have a small problem with it whenever I type some content in that
k> control
k> and press enter for next line I get double Line spacing and for
k> single line
k> spacing I need to type shift+enter.
By default, Enter does paragraph formatting (<p> </p>) — ends the current
paragraph and starts a new one, while Shift+Enter just inserts a line break
(<br/>). In most cases, the first is preferrable.
The paragraph tag has large margins above and below by default. Add a stylesheet
that sets margins for the <p/> tag to zero.
Also, if there are DIVs in the content being edited, then <div/> tags are
inserted instead of <p/>, which may also fit as they have no stock padding
or margins.
(H) Serge
kishor - 08 Jun 2005 07:18 GMT
Hi Serge,
I understand what you are saying.. but still I am not able to apply a
style. I am confused here .. dont know where to apply style. I have a div tag
only .. and user can author anything could be paragraph(s) or <Br>.. I just
want to do it for paragrph..
It will be nice if you can just paste here example...
Regards,
Kishor
> k> I have a small problem with it whenever I type some content in that
> k> control
[quoted text clipped - 14 lines]
>
> (H) Serge
Serge Baltic - 08 Jun 2005 10:32 GMT
k> I understand what you are saying.. but still I am not able to apply
k> a
k> style. I am confused here .. dont know where to apply style. I have a
k> div tag
k> only .. and user can author anything could be paragraph(s) or <Br>..
k> I just
k> want to do it for paragrph..
k> It will be nice if you can just paste here example...
Try something like this:
<html>
<head>
<style>
p { margin: 0px; padding: 0px; }
</style>
</head>
<body>
<div contenteditable="true"></div>
</body>
</html>
(I don't remember exactly a proper value for the contenteditable attribute,
take yours)
(H) Serge
kishor - 08 Jun 2005 11:05 GMT
Hi,
This is fine ..actually .. to apply style for a paragraph you need to write
like this
<P style=......> but the problem here is I dont know .. what he will typing
inside the editable div content. so in that case I need to visit each and
every inner tag of div and check whether it is a <P> and apply style. this
could be a slower solution as on every enter it will go in loop.
It will be very nice if we apply style at once somewhere....dont know how to
achieve.
Kishor
kpise hotmail
> k> I understand what you are saying.. but still I am not able to apply
> k> a
[quoted text clipped - 22 lines]
>
> (H) Serge
Serge Baltic - 08 Jun 2005 19:29 GMT
k> This is fine ..actually .. to apply style for a paragraph you need
k> to write
k> like this
k> <P style=......>
Hmm … Have you noticed the sample in my message? It applies a GLOBAL style
to ALL the paragraphs in the document. Including ones within the editable
DIV.
k> but the problem here is I dont know .. what he will
k> typing
k> inside the editable div content. so in that case I need to visit each
k> and
k> every inner tag of div and check whether it is a <P> and apply style.
This exactly is done by the browser itself, due to the P stylesheet entry.
Aye, it actually applies to the runtimerStyle property instead of style in
this case, but who cares?
(H) Serge
kishor - 09 Jun 2005 07:51 GMT
Thanxs .. solved problem
> k> This is fine ..actually .. to apply style for a paragraph you need
> k> to write
[quoted text clipped - 17 lines]
>
> (H) Serge