Solved

problem with <p> tag in editor

Posted on 2010-08-24
7
194 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Can anyone see what is the fault in my javascript code? 8 42
Debugging Html 8 31
Validating Date 4 28
How do I Enable submit button only if listbox has items 4 29
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

735 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