Code is changing with 'convert to blocks' in Gutenberg editor.
With WordPress's old editor, the code I have been using to align some text on the left and some text on the right, on the same line has been-
HTML:
<p><span class="alignleft"><big><strong>Pelagic thresher</strong></big></span><!--more--><span class="alignright fao"><strong>PTH</strong></span></p>
CSS:
span.fao {
border: 2px solid #2D325A;
border-radius:12px;
padding: 4px;
}
When I select 'convert to blocks' in the Gutenberg editor the code has changed and it becomes:
<p><span contenteditable="false" class="abt-citation"><big><strong>Pelagic thresher</strong></big></span><span contenteditable="false" class="abt-citation"><strong>PTH</strong></span></p>
Something strange happening with Academic Blogger Toolkit plugin? but it still seems to display how I want it to.
If I modify the code to:
<p><span class="alignleft"><big><strong>Pelagic thresher</strong></big></span><!--more--><br><span class="alignright fao"><strong>PTH</strong></span></p>
Then it does not display how I want, the "alighleft" text (Pelagic thresher) appears on the line ABOVE the "alignright" text (PTH)
help appreciated
Best way to align text in Gutenberg.
First, declare alignment attribute -
Then in the editor and style css file add these css -
And the relevant HTMl nodes in edit and save function -
When you use default Gutenberg editing like tool alignment, appropriate class will be applied.
FUll block code using slightly different technique -