What does a colon mean within an HTML id attribute?(HTML id 属性中的冒号是什么意思?)
问题描述
我已经看到了这样一个用于 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 属性中的冒号是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:HTML id 属性中的冒号是什么意思?


- addEventListener 在 IE 11 中不起作用 2022-01-01
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
- Flexslider 箭头未正确显示 2022-01-01
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- 400或500级别的HTTP响应 2022-01-01
- 失败的 Canvas 360 jquery 插件 2022-01-01
- Fetch API 如何获取响应体? 2022-01-01
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06