What's stopping me from using arbitrary tags in HTML?

前端 未结 7 920
礼貌的吻别
礼貌的吻别 2021-01-11 15:36

Even the new HTML5 tags aren\'t enough to describe structures without falling back to divs. What\'s stopping me from changing:

7条回答
  •  無奈伤痛
    2021-01-11 16:30

    Most browsers will just treat the tags as arbitrary (like how old browsers treat HTML5 tags). Nothing is stopping you from using your own tags, but it's not a well-accepted way to code HTML. HTML is supposed to use pre-defined tags.

    If you're interested in coding with arbitrary tags, you could just go with XML. You can format XML with XSLT (used in a way similar to stylesheets, but much more powerful). Have a look here: http://www.w3schools.com/xml/xml_xsl.asp

提交回复
热议问题