Can I use more then one span in a link?
Like this:
<a href="#" class="sprite">
<span class="iconSpan"></span>
<span class="textSpan">text</span>
</a>
Can I use more then one span in a link?
Like this:
<a href="#" class="sprite">
<span class="iconSpan"></span>
<span class="textSpan">text</span>
</a>
<span>
is inline element so you can have any no of required span elements inside another html element.
SPAN is a GENERIC inline container. It does not matter whether an a is inside span or span
is inside a
as both are inline elements. Feel free to do whatever seems logically correct to you.
try this
<a href="#" class="sprite iconSpan textSpan">
text
</a>
Yes you can have as many as you need :) a
attribute is like a div
, it covers everything inside it :)
Both forms are legal. (<a>
inside <span>
or <span>
inside <a/>
):