How to add custom HTML Tags to Visual Studio and Avoid Squiggly Lines

前端 未结 2 1223
清歌不尽
清歌不尽 2021-01-18 00:22

I\'m using Visual Studio 2013 to create raw HTML pages (i.e. index.html).

In my HTML I am implementing custom HTML tags. As such, Visual Studio underlines my custom

相关标签:
2条回答
  • 2021-01-18 00:31

    Hmm... what are you trying to accomplish? Keep in mind that if you could somehow make visual studio ignore the unknown element, that's no guarantee browsers looking at your page will be able to translate the element too.

    Are your pages HTML5? if so you've got a shot at making it work. but you'll have to define it in client code. Here is source.

    But most browsers don't support it yet! look at here elements.

    In the case of making Visual Studio recognise the tags you could take this approach:

    1) Go to: Tools > Options > Text Editor > HTML (Web Forms) > Formatting 2) Press "Tag Specific Options" 3) Select "Client HTML Tags" in the new window's treeview 4) Press "New Tag" below the treeview to add a new tag

    0 讨论(0)
  • 2021-01-18 00:53

    Visual Studio 2013 Update 4 removes the validation in .html files, but not in .aspx files.

    Support for custom elements, polymer-elements and attributes

    We no longer validate unknown attributers for custom elements as there will be many custom made tags in different frameworks. So there will no longer be squiggles under the unknown elements.

    — Announcing new Web Features in Visual Studio 2013 Update 4 RC

    Download Visual Studio 2013 Update 4.

    Validation is only removed in the HTML editor, not the HTML (Web Forms) editor. This means that, by default, .html files will not have custom element validation, but .aspx pages will. If, like me, you don't think this makes sense, show your support by voting for custom elements in .aspx files.

    0 讨论(0)
提交回复
热议问题