Solved

problem with <p> tag in editor

Posted on 2010-08-24
7
190 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to count in a table in php 22 34
How would I do a website like this? 5 54
HTML5 frame 5 25
One field not displaying content (ASP Classic) 8 23
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

785 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