Visual Studio uses XHTML tag closing for HTML5 tags

前端 未结 3 1816
时光说笑
时光说笑 2021-01-01 16:24

Whenever I type out tags that don\'t require an end tag, Visual Studio adds a forward slash to it, as if they were XHTML.

I think this is unclean and annoying, and I

相关标签:
3条回答
  • 2021-01-01 17:00

    What you could do is disable the auto closing tag option in Visual Studio.

    Go to Tools >> Options >> Text Editor >> HTML >> Formatting

    Uncheck the "Auto insert close tag" option.

    This will now allow you to type <br> (for example) and it won't auto-complete it as <br />

    0 讨论(0)
  • 2021-01-01 17:10

    For Visual Studio 2012, go to Tools -> Options -> Text Editor -> HTML -> Formatting and click Tag Specific Options.

    Under Default Settings -> Client tag does not support contents, set Closing tag to No closing tag.

    screenshot of settings interface

    0 讨论(0)
  • 2021-01-01 17:14

    For completeness I'm posting this answer. Although we're in 2014 now, with Visual Studio 2013 and HTML5 is getting more and more supported by the major browsers, Visual Studio still behaves the same as ... like always?

    The option is just a bit different than in 2010 I assume (based on accepted answer).

    Complete element tags in XHTML style with />

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