Solved

problem with <p> tag in editor

Posted on 2010-08-24
7
186 Views
Last Modified: 2012-05-13
Hi,

I have a email editor (WYSIWYG).
Iam reply for mail and set cursor at begining of mail. Arial font is set. When i wrote new text and press enter new <p> is created with this text. But 'old mail' which i reply have style on <p> and after i press enter font of that text is changed to different.

I was wondering if i can differ newly created <p> tags from old ones that newones wouldn't be able to use 'old message' styles.



0
Comment
Question by:lavitz
7 Comments
 
LVL 16

Expert Comment

by:Nenad Rajsic
ID: 33509576
quick fix: try pressing shift+enter, that will give you a new line instead of a new paragraph.

If you are looking to change the actual code behind your wysiwyg editor then you should check their support pages or post their name here and someone else might be able to tell you what to change in your code

hope that helps
0
 
LVL 4

Expert Comment

by:Morrisproject
ID: 33509607
I am a little confused by the question? Maybe some images might help here.

If you want to keep all the text entered the same from the WSYWIG you could add some overriding CSS like:
.container p {font-family:bla bla !important;}

0
 
LVL 4

Expert Comment

by:darkyin87
ID: 33512796
use of css class for the differentiating the old and new p tags will be helpful
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:lavitz
ID: 33520549
darkyin87: could you explain more? i know only  a little about css
0
 
LVL 4

Accepted Solution

by:
darkyin87 earned 500 total points
ID: 33522401
I was suggesting you can use something like this where in you will be able to attach new styles to the newly created paragraph and thereby differentiating from the previously created ones.

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style type="text/css">
<!--
.old
{
      color:red;
}
.new
{
      color:blue;
}
-->
</style>

<script type="text/javascript">

</script>

</head>
<body>
      <!-- Using Css class -->
      <p>Using CSS classes</p>
      <p class="old">Old Paragraph</p>
      <p class="new">New Paragraph</p>
      
      <!-- Using inline css -->
      <p>Using inline css</p>
      <p style="color:red">Old Paragraph</p>
      <p style="color:blue">New Paragraph</p>
      
</body>
</html>
0
 
LVL 6

Expert Comment

by:blueghozt
ID: 33526356
if you are using CKEditor or FCKEditor then you can alter the default behaviour of carriage return to use <br /> instead of <p> by using the following in your config.js - that way you can still achieve <p> tags by using shift-enter (i.e. the other way round)

CKEDITOR.editorConfig = function( config )
{
config.enterMode = CKEDITOR.ENTER_BR;
config.shiftEnterMode = CKEDITOR.ENTER_P;
};
0
 

Author Comment

by:lavitz
ID: 33529423
iam afraid i cant add class to <p> becouse, component do it.
But !important works fine. However i wondering if is safe and it wouldn't change old message styles.

So my question is. If i have style

<style definition for <p> >
<p> some new text </p>

<second style definition for <p> >
<p> some old text </p>

these texts will be rendered by one style or each text by different style?


0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now