开发者

html span tag within span tag

开发者 https://www.devze.com 2023-04-13 07:58 出处:网络
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.

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

精彩评论

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