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
Solved

problem with <p> tag in editor

Posted on 2010-08-24
7
193 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…

861 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