Solved

problem with <p> tag in editor

Posted on 2010-08-24
7
201 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

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!

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

627 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