开发者

html span tag within span tag

Is it ok to have a span tag within another span tag? I need to format the digits 开发者_JAVA百科within a span tag with jquery.

<span id="tprice">The price is: $95</span>


Yes, it's OK. There's no rule which forbids, nor discourages this practice.

If that piece of HTML occurs more than once, replace id="tprice" by class="tprice", because the ID must only occur once.


Sure, you could even put a span tag within a span tag within a span tag ;).

This is actually pretty common and required in some instances such as when dealing with microformats/microdata.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜