Visual Studio为HTML5标记使用XHTML标记关闭 [英] Visual Studio uses XHTML tag closing for HTML5 tags

查看:276
本文介绍了Visual Studio为HTML5标记使用XHTML标记关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我输入不需要结束标签的标签时,Visual Studio就会向它添加一个正斜杠,就好像它们是XHTML一样。



我觉得这个是不干净和烦人的,我希望任何人都可以告诉我如何解决或解决这个问题。

它甚至发生在我完成 <!DOCTYPE html > ,它将形成<!DOCTYPE html />

解决方案

您可以做的是在Visual Studio中禁用自动关闭标记选项。 >

转至工具>>选项>>文本编辑器>> HTML >>格式化



取消选中Auto insert close tag 选项。



现在,您可以输入< br> (例如) t自动完成它为< br />


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

解决方案

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

这篇关于Visual Studio为HTML5标记使用XHTML标记关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆