I'm struggling with a simple problem. I'm using <a>
to link a whole block full of content, instead of linking through title or image, I want to link the whole content, and if I had to place everything into an inline <a>
element, I would end up with bunch of spans, and I would rather use more semantic code, so I was thinking about placing empty <a>
element before everything else and then use more semantic tags for the content.
What I had before:
<p>
<a href="">
<span class="percent">- 27%</span>
<span class="images"><span><img src="img/img02.png" alt=""></span></span>
<span class="title">Špičkový šlehač Š-LEH-NIHO, pomocník každé hospodyňky</span>
<span class="bottom-part">
<span class="price"><b>18 599</b> Kč</span>
<span class="status available">Skladem</span>
</span>
</a>
</p>
Obviously, each of those tags is necessary, because it requires different styling. This might be something completely ridiculous that most of you solved years ago, but I tend to run into it quite regularly and every time I feel bad about using those spans - what is worse, using that empty link tag, or placing everything into it and having spans with long classes?