Page 1 of 1

How to add headings inside a div?

Posted: Wed Aug 18, 2021 6:34 pm
by Tata
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.

Re: How to add headings inside a div?

Posted: Wed Aug 18, 2021 10:17 pm
by cmb
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.

Re: How to add headings inside a div?

Posted: Thu Aug 19, 2021 8:36 am
by Tata
It seems to work only with TMCE5. I, somehow, don’t like this version very much. Let’s see...