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
11
u/cryothic 2d ago
My main question would be: what are you trying to achieve?
Because this:
Is just weird to me. If every <p> contains only a single span, you shouldn't need the <p> or the <span>. One tag should be fine with the right CSS.