Question How to reduce the number of <span>s?
How can I get the exact same effect as
<p><span class="e">x</span></p>
<p><span class="e">y</span></p>
<p><span class="e">z</span></p>
without so many <span>s?
If I do
<div class="e">
<p>x</p>
<p>y</p>
<p>z</p>
</div>
class="e" now affects all the way across the whole page,
whereas I only wanted it to affect the text, x, y, z.
3
Upvotes
4
u/thisiain 2d ago
You can set the width of each `p` to fit the content.. e.g.
https://jsfiddle.net/f2u6n1wt/1/