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; asemicolon(;) doesn't separate class names.
噢,我忘了我在哪個帖子裡放了個厥詞說formal English裡不用',如doesn't要寫成does not. 我是誤信了詞典啊,起碼IBM在它的官網上don't多的是——它還是穿西裝不是穿T恤的公司。