Custom tags… why not?

后端 未结 5 1649
逝去的感伤
逝去的感伤 2020-11-30 06:10

I found a site with an guide to add custom tags to html, the same way people make ie work with the new HTML5 tags. I must admit I think it would be great to add my own tags,

5条回答
  •  北荒
    北荒 (楼主)
    2020-11-30 06:14

    There are a number of reasons why you shouldn't do this.

    1. First: By creating your own tags like that, you lose the functionality of tags like ul and li. Your custom tags will just be generic divs, and that won't give you the results you are looking for.Yes, you can style the tags to duplicate those functions, but why spend all that time doing something that browser already does.

    2. Second: People with disabilities will not be able to utilize your site, because it won't conform to any standard HTML. Those who are blind will use assistive technologies that read the html and present the contents verbally.

    Another reason is that browsers and javascript don't always work really well with these custom tags. You will likely run into more problems than you imagine. It will be harder to make your apps cross-platform if you do this.

提交回复
热议问题