Is there a way, using CSS only, to ask a browser to render this
<p>One <span class="foo">Two</span> Three</p>
as if I had written
<p>One Three</p>
<span class="foo">Two</span>
The reason I want to do this is that I want to dynamically reorder certain spans to render after their parent on mobile devices and inside their parent on wide screens.
2
Answers
A very hacky way to use with caution that works only for your specific case
This is a tad brittle, but could be modified to be less so, like adding a bottom padding area for the
p
element to make sure there’s space for the span: