1

Is it possible to indent after a heading tag (h1-h6)? I tried it with CSS and the CKEditor dataprocessor.

I need the following work-flow: User:

  1. Write a heading and set it to h1
  2. Enter some text after the h1 heading

Output:

<h1>Heading h1</h1>
<p style="margin-left: 40px;">Content</p>

Attempt in CSS:

p {
     text-indent: 40px;
     /* or -> margin-left: 40px; */
}

But then it is set for all p-tags

Is this possible with CKEditor or should I solve this with CSS?

gregor
  • 2,397
  • 2
  • 12
  • 18

1 Answers1

0

Try this in your contents.css:

h1 + p {
    text-indent: 40px;
}

And see: What does the "+" (plus sign) CSS selector mean?

Community
  • 1
  • 1
Reinmar
  • 21,729
  • 4
  • 67
  • 78
  • Wow this was fast. I found the sibling definitions seconds before and want to share the exact same solution. – gregor Apr 15 '15 at 13:48