How to add headings inside a div?

About the template and stylesheet - and changing the menu
Post Reply
Tata
Posts: 3586
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

How to add headings inside a div?

Post by Tata » Wed Aug 18, 2021 6:34 pm

I want create a page structure about like this:

Code: Select all

<div class="black">
<h1 class="white">White heading</h1>
<h1 class="red">Red heading</h1>
<p class="white">White paragraph text</p>
</div>
<p>Another paragraph in "black on white"</p>
<div class="black">
<h1 class="white">White heading</h1>
<h1 class="red">Red heading</h1>
<p class="white">White paragraph text</p>
</div>
So far, I can make it only while editting the page in TMCE4 HTML mode. Is there any easier way to do it directly in Edit mode?
EDIT:
I have installed the CKEditor and I see, this is very close to what I want. It is just that the logic of creation of such nested structure is slightly upside-down. But works almost perfectly.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: How to add headings inside a div?

Post by cmb » Wed Aug 18, 2021 10:17 pm

Indeed, that's what I remember: TinyMCE4 can't wrap an HTML fragment in a <div>, while CKEditor supports that; but you need to work from inside out. I don't know whether TinyMCE5 can wrap HTML fragments in <div>s, but apparently it can wrap them in HTML containers; that might be more useful anyway.
Christoph M. Becker – Plugins for CMSimple_XH

Tata
Posts: 3586
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: How to add headings inside a div?

Post by Tata » Thu Aug 19, 2021 8:36 am

It seems to work only with TMCE5. I, somehow, don’t like this version very much. Let’s see...
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

Post Reply