Any crossbrowser issues with making up your own HTML elements?
I understand that with a few simple arrangements, the new HTML5 elements can be used even in older browsers. Does this mean the browsers simply don't really care about what the tags are named? So would there be any critical issues with m开发者_C百科aking up your own elements, like <comments></comments>
or <feature></feature>
or <chapter></chapter>
or whatever, instead of using id's and classes?
I realize it's pretty stupid and unnecessary, but from a hypothetical point of view, would it be likely to cause any actual problems?
For Internet Explorer to show your new tags, you need to do this in JavaScript:
document.createElement('comments');
The new element will have no styles and defaults to display: inline;
.
Other than that, you can use any tags you want.
Be sure to use HTML5's doctype: <!DOCTYPE html>
精彩评论