www.webdeveloper.com
Results 1 to 3 of 3

Thread: accessing elements with jquery

  1. #1
    Join Date
    Nov 2007
    Posts
    140

    accessing elements with jquery

    i am using tiny mce editor to add content to pages, when i hit enter the editor automatically generates
    <p>&nbsp;</p> or <p> </p>

    i cannot change the settings of tiny mce so that i can change line breaks to be <br> instead of <p>&nbsp;</p> or <p> </p>

    in my css i have given the following
    .content p{
    margin: 0 0 8px 0;
    line-height: 18px;
    }

    so that the content which is within p tags will get the line height and margins between paragraphs that have the content

    because of the empty <p>&nbsp;</p> that the editor is generating both the line height and margin bottom are being applied to <p>&nbsp;</p> and there is a big vertical gaps being created

    is it possible using jquery to find <p>&nbsp;</p> or <p> </p> so that a new css rule can be set so that these empty p tags will have no line height and very less margin example
    $(document).ready(function(){
    $("find empty p").css("line-height","0");
    $("find empty p").css("margin-bottom","2px");
    });

  2. #2
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    Quote Originally Posted by sudhakararaog View Post
    i am using tiny mce editor to add content to pages, when i hit enter the editor automatically generates
    <p>&nbsp;</p> or <p> </p>

    i cannot change the settings of tiny mce so that i can change line breaks to be <br> instead of <p>&nbsp;</p> or <p> </p>
    Simply press Shift+Enter. That should generate <br> instead of <p> in almost all kind of editors.

  3. #3
    Join Date
    Nov 2007
    Posts
    140
    thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles