开发者

difference between <text> and <span>

What the difference between them? Is the <text> even proper HTML tag? I've never seen the de开发者_如何学运维scription of it on sites like http://www.w3schools.com/ but it seems to be working fine ( http://jsfiddle.net/qgaA2/ ) and I don't see any difference between it and <span>


No, it's not a real tag. The browser just looks at the attributes and makes the best of it.

This will work too: <stupidtag style="color:red">moo</stupidtag>


I'm not sure that <text> tag exists, and my reference is w3c.


If you want to ensure cross browser compatibility use the <span> tag. Not all browsers will recognize what to do with <text>.


<text> tag does not exists, but the browsers displays anyway, just for the best compatibility.


For a large amount of similar formatted text use <p> as it defines a paragraph. For special formatted text use <span>.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜