Visual Studio uses XHTML tag closing for HTML5 tags

Viewed 3206

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'm hoping anyone can tell me how to fix or work around this issue.

It even happens when I complete <!DOCTYPE html with a >, and it'll form <!DOCTYPE html />.

3 Answers

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 />

Related