我已经看到了这样一个用于 ID 属性的 HTML 代码:
I have seen an HTML code like this for the ID attribute:
id="t1:c3"
谁能给我解释一下?冒号 (:
) 的用途是什么?
Can someone explain this to me? What is the purpose of the colon (:
)?
谢谢.
ID 属性中允许使用冒号,但没有特殊意义.不建议使用它们,因为它们有时会导致问题,例如与 jQuery 或 CSS 一起使用时,冒号作为伪选择器具有特殊含义.
Colons are allowed inside ID attributes, but hold no special significance. It's not really advisable to use them because they can sometimes cause problems, such as when used with jQuery or CSS, where the colon has special meaning as a pseudo-selector.
这篇关于HTML id 属性中的冒号是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!