[SOLVED] DIV inside TinyMCE - or horizontal lines in content

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
janvl
Power Poster
Power Poster
Posts: 973
Joined: Wed Aug 13, 2008 10:57 am

[SOLVED] DIV inside TinyMCE - or horizontal lines in content

Post by janvl »

Hi all,

I wanted to put a horizontal ruler inside content.
Since is reserved for accessability I copied the code in the stylesheet:

div.horlin {
  height: 2px;
  padding: 1em;
  border-bottom: 2px solid #DDD;
  margin: 1em;
}

and added in NON-wysiwyg


If I save this I can se the line, BUT . . .If I try to edit the page again the code
"" is no longer visible
making it hard to get a good layout.

How does one solve this?

Well I made a user defined tag called "horiline" put the following php-code in it
echo "";

and use {horiline} which works perfect.

Thanks,
Jan
Last edited by janvl on Tue Nov 24, 2009 9:06 pm, edited 1 time in total.
Fraserm
Forum Members
Forum Members
Posts: 107
Joined: Wed Mar 04, 2009 2:27 pm

Re: [SOLVED] DIV inside TinyMCE - or horizontal lines in content

Post by Fraserm »

I know you solved your own issue and that's great, but I would have done it a bit different, purely to make it nicer for an average user to achieve...

Create the 'horline' class in a stylesheet and link that to TinyMCE with a simple meaningful name like 'horizontal separator', so that your users can take a new line where they need the separator and simply select the line from the style list.

In doing that you'd just span an empty paragraph with your 'horline' class and maybe that's not a good idea, but it does work.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: [SOLVED] DIV inside TinyMCE - or horizontal lines in content

Post by Dr.CSS »

Tiny ate it because it was empty, you may have wanted to try   but ...
janvl
Power Poster
Power Poster
Posts: 973
Joined: Wed Aug 13, 2008 10:57 am

Re: [SOLVED] DIV inside TinyMCE - or horizontal lines in content

Post by janvl »

Hi Fraserm

I will try that, later. The customer is already using the user defined tag.

Thanks anyway.

Jan
applejack
Power Poster
Power Poster
Posts: 1014
Joined: Fri Mar 30, 2007 2:28 am

Re: [SOLVED] DIV inside TinyMCE - or horizontal lines in con

Post by applejack »

Re: Tiny ate it because it was empty.

I am sure that before it didn't. Is there a way of stoping it doing so?
Post Reply

Return to “Layout and Design (CSS & HTML)”