block editor - How can I get rid of extra line space in this poetry stanza

admin2025-05-31  0

I do not want a space before the settles line. I've tried removing the </p> at the end of dust but the Wordpress editor keeps putting it back. I tried replacing it with
but the system changes it back to </p>. How do I get rid of the extra line space? This is a stanza of poetry so the three lines need to be together. Here is the code:

<p style="text-indent: 25px;">Then the sun sinks, swallowed by the dark. In that dark
more dust, always more dust</p>
<p style="text-indent: 100px;">settles—sighs over everything.</p>

I do not want a space before the settles line. I've tried removing the </p> at the end of dust but the Wordpress editor keeps putting it back. I tried replacing it with
but the system changes it back to </p>. How do I get rid of the extra line space? This is a stanza of poetry so the three lines need to be together. Here is the code:

<p style="text-indent: 25px;">Then the sun sinks, swallowed by the dark. In that dark
more dust, always more dust</p>
<p style="text-indent: 100px;">settles—sighs over everything.</p>
Share Improve this question edited May 9 at 19:22 fuxia 107k39 gold badges255 silver badges461 bronze badges asked May 9 at 19:01 Deidra LyngardDeidra Lyngard 1 3
  • Did you try using Shift+Enter instead of just Enter? That should create a <br/>, which doesn't generate the extra paragraph space. – fuxia Commented May 9 at 19:24
  • I think the issue is with the text indent which the system is insisting needs a </p> at the end of the line, but that creates the space. I tried putting in a <br> but the system replaces it with a </p>. Thanks anyway. – Deidra Lyngard Commented May 9 at 19:47
  • Instead of trying to fight the paragraph formatting in a regular Paragraph block, switch to a Custom HTML block, where WordPress won’t auto-correct your HTML. – Arizona Web Development Commented May 9 at 19:55
Add a comment  | 

1 Answer 1

Reset to default 0

Yes custom HTML block can be a solution but I am sure you also need the formating options in block editor.

Here is a simple solution, Just create a css class:

.redspace {
  margin-bottom: 0; //what ever you like the space to be: 10px 5px...
}

Now apply this class to the p where you dont want the space. in your case:

<p style="text-indent: 25px;" class="redspace">Then the sun sinks, swallowed by the dark. In that dark
more dust, always more dust</p>

Thats it.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748631576a313659.html

最新回复(0)