<custom> html tags without function?
6 answers
Short answer; no. It is invalid (except for XHTML, where you can add such tags)
It will not only break in some browsers, but for other people it will be confused.
See this qustion: https://stackoverflow.com/questions/211394/when-to-use-custom-html-tags
+2
W3C, , . , HTML, CSS JavaScript. HTML-, , . , . , .
, .. HTML- .
CSS CSS HTML, CSS - XML (, CSS XML). , .
, . HTML5, ? data . Ex. <a href='...' data-custom-attribute='custom-value'></a>.
0
:
- IE 6-8 → JavaScript , , :
document.createElement('custom-tag'), - JavaScript <span>, , CSS,custom-tag { display: block }- , , . Google Angular.js, (
<pane><tab>) a href= "http://angularjs.org/" rel= "nofollow" > . - HTML HTML, .
- - HTML ( , .)
:
- , ,
<div>HTML 4/5 . -, DOM // (, Angular.js). - , , - , HTML. , JavaScript.
- If you are building a web application where custom tags can really help make the source cleaner and express special semantics, use them. All the negative consequences mentioned above (JavaScript must be enabled / CSS declaration) will not be of great importance for these cases, since your web application will not work without them. The same rules apply to user attributes.
0