What does a colon mean within an HTML id attribute?
[stackoverflow]
Q. 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 (:)? Thank you.
A. 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.
A. If the HTML is generated with Java ServerFaces this usually produces such IDs, i.e. if the form has the ID form1 and the element has the ID firstName this results in an ID form1:firstName.
我. 博客园的语法高亮:<div class="cnblogs_Highlighter"><pre class="brush:python;collapse:true;;gutter:false;">
<style> .A {color:red} .B {text-decoration:underline} </style> <p>classname 规定元素的类的名称。如需为一个元素规定多个类,用空格分隔类名。HTML 元素允许使用多个类。</p> <p class="A B">classname 规定元素的类的名称。如需为一个元素规定多个类,用空格分隔类名。HTML 元素允许使用多个类。</p> <p class="A;B">classname 规定元素的类的名称。如需为一个元素规定多个类,用空格分隔类名。HTML 元素允许使用多个类。</p>
上面的pre只属于一个类,它的名字是brush:python;collapse:true;;gutter:false; a semicolon(;) doesn't separate class names.
噢,我忘了我在哪个帖子里放了个厥词说formal English里不用',如doesn't要写成does not. 我是误信了词典啊,起码IBM在它的官网上don't多的是——它还是穿西装不是穿T恤的公司。